Created
July 2, 2016 08:37
-
-
Save IT-Berater/9b8ef713760582b617a53893081442d5 to your computer and use it in GitHub Desktop.
String join with Java 1.8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void stringJoinTest() { | |
CharSequence delimiter = ","; | |
// Returns a new String composed of copies of the CharSequence elements | |
// joined together with a copy of the specified delimiter | |
String alleFarben = String.join(delimiter, "rot", "grün", "BLAU"); | |
assertEquals("rot,grün,BLAU", alleFarben); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment