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.
string.toCharArray() underneath makes a copy of the String character array (defensive programming)
If we prepare array by making new char[string.lenth()] and then iterate trought string using chatAt(i) we could avoid one array copy
string + string in a loop = multiple stringbuilders => bad
1 stringbuider (appending in a loop) => good
source? since what version?
I have been told that String use StringBuilder in higher version, so it isn't necessary anymore.
Definitely true, but in case of few number of iterations, like in the cata above, you won't notice a difference in time