Java Array to String arrayToString(String[] arrayString, String splitStr)

Here you can find the source of arrayToString(String[] arrayString, String splitStr)

Description

array To String

License

Apache License

Declaration

public static String arrayToString(String[] arrayString, String splitStr) 

Method Source Code

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

public class Main {

    public static String arrayToString(String[] arrayString, String splitStr) {
        StringBuilder sb = new StringBuilder();
        if (arrayString == null || arrayString.length == 0) {
            return null;
        }/* w ww  . j a v a2s.c  om*/
        for (int i = 0; i < arrayString.length; i++) {
            if (arrayString[i] != null && arrayString[i].length() > 0) {
                if (sb.length() > 0) {
                    sb.append(splitStr);
                }
                sb.append(arrayString[i]);
            }
        }
        return sb.toString();
    }
}

Related

  1. arrayToString(String[] array, int start, String delimiter)
  2. arrayToString(String[] array, String delim, boolean quotes)
  3. arrayToString(String[] array, String separator)
  4. arrayToString(String[] array, String separator)
  5. arrayToString(String[] array, String separators)
  6. arrayToString(String[] input)
  7. arrayToString(String[] lengthsAndDelimiters)
  8. arrayToString(String[] lines, String separator)
  9. arrayToString(String[] ngram)