Here you can find the source of arrayToString(String[] lines, String separator)
static String arrayToString(String[] lines, String separator)
//package com.java2s; //License from project: Open Source License public class Main { static String arrayToString(String[] lines, String separator) { StringBuilder builder = new StringBuilder(); String prefix = ""; for (String s : lines) { builder.append(prefix).append(s); prefix = separator;/*from www.j a v a2 s .c om*/ } return builder.toString(); } static String arrayToString(String[] lines) { return arrayToString(lines, "\n"); } }