Here you can find the source of mergeStringsFormatted(String[] strings, String spacer)
public static String mergeStringsFormatted(String[] strings, String spacer)
//package com.java2s; //License from project: Open Source License public class Main { public static String mergeStringsFormatted(String[] strings, String spacer) { StringBuilder builder = new StringBuilder(strings.length); for (String str : strings) { builder.append(spacer);/*from ww w . j a va 2s . com*/ builder.append(str); builder.append("\n"); } return builder.toString(); } }