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.
.
The difference is how you can call this function. The array variant can only be called with an array
while the varargs variant can be called with an array or with separate arguments
and the java compiler will create the array for you under the hood.
yes, Strings are always immutable (unchangable)
But now you do...
This comment is hidden because it contains spoiler information about the solution
Wish I knew the replace method......
Massive W to all Java devs on StackOverflow
And is correct that way because inputs "... are always lowercase strings, and that each has at least two letters.". If that was not the case and arbitrary inputs would be allowed we'd also need checks for
null
and lengths in order to avoidNullPointerException
andIndexOutOfBoundsException
or alike.it work only if cases are equal
I would rather have more spaces to increase the readability of the code, but it's okay
what is the difference between
type[]
andtype...
?Actually IntStream.of() calls Arrays.stream()
From IntStream.java :
I googled, and may be understood the patterns problem you mentioned. But this version is same as:
replace(char oldChar, char newChar) right?
Is this solution better than solution with Arrays.stream()?
Very efficient
Loading more items...