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.
Good point. StringBuilder is the way to go. 10 months ago I didn't even know about SB :P
.length points to just a field of array object. No calculations are even beeing performed at this point.
The much worse is concatenating strings in a cycle. That's a very bad practice
You make unnecessary calls to friends.length. This is never going to change throught the execution of this method, so to optimize your code you should define it as a variable in the beginning. You are basically making a function call to friends.length each iteration of the for loop as well as when defining your "ret" array. Just a heads up!