Java Array to String arrayToString(String[] a, String separator)

Here you can find the source of arrayToString(String[] a, String separator)

Description

array To String

License

Open Source License

Declaration

public static String arrayToString(String[] a, String separator) 

Method Source Code

//package com.java2s;

public class Main {
    public static String arrayToString(String[] a, String separator) {
        StringBuffer result = new StringBuffer();
        if (a.length > 0) {
            result.append(a[0]);/* w  w  w .  ja v a  2s .com*/
            for (int i = 1; i < a.length; i++) {
                result.append(separator);
                result.append(a[i]);
            }
        }
        return result.toString();
    }
}

Related

  1. arrayToString(String array[], String separator)
  2. arrayToString(String format, double[] array)
  3. arrayToString(String in[])
  4. arrayToString(String values[])
  5. arrayToString(String[] a, String delim)
  6. arrayToString(String[] args, String delimiter)
  7. arrayToString(String[] arr)
  8. arrayToString(String[] arr, String expr)
  9. arrayToString(String[] array)