Java String Array Merge merge(String[] src, String delimiter)

Here you can find the source of merge(String[] src, String delimiter)

Description

merge

License

Apache License

Declaration

public static String merge(String[] src, String delimiter) 

Method Source Code

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

public class Main {

    public static String merge(String[] src, String delimiter) {
        StringBuffer newSrc = new StringBuffer();
        for (int i = 0; i < src.length; i++) {
            if (i < src.length - 1) {
                newSrc.append(src[i]).append(delimiter);
            } else {
                newSrc.append(src[i]);/*from w  w  w.  ja v a2  s.c  o  m*/
            }
        }
        return newSrc.toString();
    }
}

Related

  1. merge(String[] arr)
  2. merge(String[] mainSelector, String[] base)
  3. merge(String[] pieces, String sep)
  4. merge(String[] str, String sep)
  5. merge(T[] arr0, String delimiter)
  6. mergeInts(int[] values, String delimiter)
  7. mergeJoin(String sep, String[] a1, String[] a2)