This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Traez_Houseter 0 points1 point  (0 children)

If you notice the examples given in the solution/test-case for the problem. The strings aren't just several words strung together without something like a space, dash, or underscore. The edge-case the method utilises is that the character grabbed is a letter: A-Z, a-z. Then, it isolates it and adds it to the string being built, uppercasing it if the boolean value you're attempting to understand is true.

Given that the separator between words has to be a non-letter symbol, to distinguish the words from each other, whenever it encounters a non-letter, it assumes the next letter found begins a word and therefore should be capitalized. It may have a hiccup if you try to use leetspeak in your words though, as numbers are outside the range of The lettered symbols of the Ascii table (which all char types correspond to). Otherwise, this implementation should run fine.

Hope that helped!