Java Array to String arrayToString(String[] s, String delim)

Here you can find the source of arrayToString(String[] s, String delim)

Description

Array to string.

License

Apache License

Parameter

Parameter Description
s the s
delim the delim

Return

the string

Declaration

public static String arrayToString(String[] s, String delim) 

Method Source Code

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

public class Main {
    /**//from   w ww .j  a  va2  s.  com
     * Array to string.
     * 
     * @param s
     *            the s
     * @param delim
     *            the delim
     * @return the string
     */
    public static String arrayToString(String[] s, String delim) {
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < s.length; i++) {
            buf.append(s[i]).append(delim);
        }
        return buf.toString().substring(0, buf.length() - 1);
    }
}

Related

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