Here you can find the source of strjoinNL(String... args)
public static String strjoinNL(String... args)
//package com.java2s; import java.util.List; public class Main { /** strjoin with a newline as the separator */ public static String strjoinNL(String... args) { return join("\n", args); }/*from w w w.j a v a 2 s . c o m*/ /** strjoin with a newline as the separator */ public static String strjoinNL(List<String> args) { return join("\n", args); } private static String join(String sep, List<String> a) { return join(sep, a.toArray(new String[0])); } private static String join(String sep, String... a) { if (a.length == 0) return ""; if (a.length == 1) return a[0]; StringBuffer sbuff = new StringBuffer(); sbuff.append(a[0]); for (int i = 1; i < a.length; i++) { if (sep != null) sbuff.append(sep); sbuff.append(a[i]); } return sbuff.toString(); } }