Skip to content

Instantly share code, notes, and snippets.

@IT-Berater
Created July 2, 2016 08:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IT-Berater/9b8ef713760582b617a53893081442d5 to your computer and use it in GitHub Desktop.
Save IT-Berater/9b8ef713760582b617a53893081442d5 to your computer and use it in GitHub Desktop.
String join with Java 1.8
@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