X1664: unMakeCamelCase

Given a string, compute recursively a new string where uppercase letters in the original one are preceeded with a space in the new string.

All strings start with lowercase and might have some letters in uppercase. Detect the uppercase and insert a " ".

So given "helloWorld", return "hello World".

The method Character.isUpperCase(char) can be used to check if a letter is uppercase.

Examples:

unMakeCamelCase("helloWorld") -> "hello World"
unMakeCamelCase("hELLO") -> "h E L L O"
unMakeCamelCase("atTheEnd") -> "at The End"

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.