X662: Title Case for Some Words

Write a function toTitleCase(s) that returns the s converted to Title Case. Title case has each word in the s with its first letter in upper case. All other letters must be in lowercase. There is one exception. Do not convert words with length of three characters or less. Those words should be all in lowercase.

Examples:

toTitleCase("WHERE WE GO FROM HERE") -> "Where we go From Here"
toTitleCase("i have a dream") -> "i Have a Dream"

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.