Java Array to String ArrayToString(String[] values)

Here you can find the source of ArrayToString(String[] values)

Description

Array To String

License

Open Source License

Declaration

public static String ArrayToString(String[] values) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String ArrayToString(String[] values) {
        return ArrayToString(values, ',');
    }/*from www .  j a  va 2s .c o m*/

    public static String ArrayToString(String[] values, char delimiter) {
        String result = "";
        int offset = 0;

        for (String value : values) {
            if (value.indexOf(delimiter) >= 0) {
                result += "\"" + value + "\"";
            } else
                result += value;

            offset++;

            if (offset < values.length) {
                result += delimiter;
            }
        }

        return result;
    }
}

Related

  1. arrayToString(String[] strs, String separator)
  2. arrayToString(String[] theArray)
  3. arrayToString(String[] values)
  4. arrayToString(String[] values)
  5. arrayToString(String[] values)
  6. arrayToString(String[] values)
  7. arrayToString(String[] values)
  8. arrayToString(T[] ar)
  9. arrayToString(T[] array)