Java Array to String arrayToString(String[] str, char sep)

Here you can find the source of arrayToString(String[] str, char sep)

Description

Convert a string array to a string separated by some char.

License

Open Source License

Declaration

public static String arrayToString(String[] str, char sep) 

Method Source Code

//package com.java2s;
//  in accordance with the terms of the license agreement accompanying it.

public class Main {
    /**//from   ww w . j a va 2 s.  c o  m
     * Convert a string array to a string separated by some char.
     **/
    public static String arrayToString(String[] str, char sep) {
        if (str == null)
            return null;

        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < str.length; i++) {
            sb.append(str[i]);
            sb.append(sep);
        }
        return sb.toString();
    }
}

Related

  1. arrayToString(String[] lengthsAndDelimiters)
  2. arrayToString(String[] lines, String separator)
  3. arrayToString(String[] ngram)
  4. arrayToString(String[] object)
  5. arrayToString(String[] s, String delim)
  6. arrayToString(String[] str, String separator)
  7. arrayToString(String[] stringArray)
  8. arrayToString(String[] stringArray)
  9. arrayToString(String[] strings)