Java String Array Merge mergeStringsFormatted(String[] strings, String spacer)

Here you can find the source of mergeStringsFormatted(String[] strings, String spacer)

Description

merge Strings Formatted

License

Open Source License

Declaration

public static String mergeStringsFormatted(String[] strings, String spacer) 

Method Source Code

//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();
    }
}

Related

  1. mergeString(String currentValue, String newValue)
  2. mergeString(String[] str1, String[] str2)
  3. mergeStrings(Object... strings)
  4. mergeStrings(String s1, String s2)
  5. mergeStrings(String[] str1, String str1Tag, String[] str2)