Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Because converting more than 1 letter to upper case is more computationally expensive than converting 1 letter to upper case.
how so? /genq
according to my introduction to logic (or was it structired programming? cant remember) class, doing that is considered "defensive programming" and isn't a good practice.
to clarify, i think they mean doing checks like that when they arent needed. if the excercise says the input will always be a valid string, then you shouldnt do a check for that
Great
Not sure what you're trying to say. But this solution is wasteful.
strings are immutable, there's no differece converting the whole name or fisrt char if youre not reassociating.
Do we not need curly brackets for if statements?
Does this only work because the else statement is that final thing running?
looking at it (or the lack there of) is making my skin crawl!
LOL there's a .startsWith() function??
Please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
Although I can understand the function but it is not my choice.
It confused me.
Its allways better to check like
if(name == null) throw new IllegalArgumentException("name must not be null");
even if the description says that only valid strings appear
Names given are always valid strings.
name is an object, so I think checking for null should be done.
awesome kata)))