Skip to content

Instantly share code, notes, and snippets.

@ivanopagano
Created March 17, 2015 13:43
Show Gist options
  • Save ivanopagano/4507a6f837a65935e633 to your computer and use it in GitHub Desktop.
Save ivanopagano/4507a6f837a65935e633 to your computer and use it in GitHub Desktop.
joining strings in java 8
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