kotlin-coding-challenges

Decapitalize const

Instructions

Given a string representing constant name (upper case words separated by underscore eg FOO_BAR) implement a function which converts it into variable name (eg. fooBar):

Challenge Solution

Examples

decapitalizeConst("FOO") // foo

decapitalizeConst("FOO_BAR") // fooBar

decapitalizeConst("__FOO_BAR_BAZ") // fooBarBaz