Java String Array Merge merge(String[] arr)

Here you can find the source of merge(String[] arr)

Description

merge

License

Apache License

Declaration

public static String merge(String[] arr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String merge(String[] arr) {
        if (arr.length == 0)
            return "";
        StringBuilder str = new StringBuilder();
        for (String s : arr)
            str.append(s).append(' ');
        return str.toString().substring(0, str.length() - 1);
    }/*ww w .  j  ava  2 s  .  co  m*/
}

Related

  1. merge(String[] mainSelector, String[] base)
  2. merge(String[] pieces, String sep)
  3. merge(String[] src, String delimiter)
  4. merge(String[] str, String sep)