Created
March 17, 2015 13:43
-
-
Save ivanopagano/4507a6f837a65935e633 to your computer and use it in GitHub Desktop.
joining strings in java 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
import java.util.*; | |
public class Joiner { | |
public static void main(String[] args) { | |
System.out.println(String.join("\n", Arrays.asList(args))); | |
System.out.println(String.join("\n", testArgs())); | |
} | |
private static List<String> testArgs() { | |
return Arrays.asList("java 8", "in", "the", "house"); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment