Java String Array Combine combineStringArray(String[] array, String delim)

Here you can find the source of combineStringArray(String[] array, String delim)

Description

combine String Array

License

Open Source License

Declaration

public static final String combineStringArray(String[] array, String delim) 

Method Source Code

//package com.java2s;

public class Main {

    public static final String combineStringArray(String[] array, String delim) {
        int length = array.length - 1;
        if (delim == null) {
            delim = "";
        }/*  w ww  .  j a va2 s .  co  m*/
        StringBuffer result = new StringBuffer(length * 8);
        for (int i = 0; i < length; i++) {
            result.append(array[i]);
            result.append(delim);
        }
        result.append(array[length]);
        return result.toString();
    }
}

Related

  1. combineSplit(final int startIndex, final String[] string, final String seperator)
  2. combineSplit(int startIndex, String[] string, String separator)
  3. combineSplit(int startIndex, String[] string, String separator)
  4. combineSplit(int startIndex, String[] string, String separator)
  5. combineString(String[] strArr, String glue)
  6. combineStrings(Object... strings)
  7. combineStrings(Object[] list)
  8. combineStrings(String[] strings)