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.
I love this solutions for it's learning to me more about the new things and new ways for the solutions and new concepts, I love CodeWars.
finally, i know my english is very bad "_"
just static method does all the work :)
Bonus emphasis?
Have a nice day
Somebody actually read the documentation for String, it seems.
What about test cases like this?
Brilliant decision!
every time i see those 1-line solutions after for-looping everything i feel like a dummy
It's required to trim the result to avoid emtpy spaces in the beginning and the end of the resulting sentence - it is one of the requirements. I've added a test case method to check that for array [" ", "a", "b", " "] there is a result "a b", and not " a b ", but somehow my solution is marked as the one not passing anymore (was passing but the kata has changed).
Does this code still solve the kata? I might have missed something, but it throws an error about null when I tried it.
Interesting :) Thank you Zoidby
it's notation for variable number of String parameters or just an array
Why does the String... work in the argument list?
It finally appeared in Java 8 and uses StringJoiner class.
Wow, quite impressive, one line and it's done! Wonder where does the join come from? I mean, I'd never seen it before, is it new?
True, but an array can be initialized with null, then you will get NullPointerException:
String[] test = null;
and considering there was a test
i'd go for a null check before returning.
Loading more items...