Java Array to Delimited String arrayToDelimitedString(String[] values, String delimiter)

Here you can find the source of arrayToDelimitedString(String[] values, String delimiter)

Description

array To Delimited String

License

Open Source License

Declaration

public static String arrayToDelimitedString(String[] values, String delimiter) 

Method Source Code

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

public class Main {
    public static String arrayToDelimitedString(String[] values, String delimiter) {
        StringBuffer str = new StringBuffer();
        for (String val : values) {
            if (str.length() > 0) {
                str.append(delimiter);/*from   w w w  .j  av a  2 s  .c om*/
            }
            str.append(val);
        }
        return str.toString();
    }
}

Related

  1. arrayToCommaString(int[] array)
  2. arrayToCommaString(int[] array)
  3. arrayToDelimitedString(Object[] arr, String delim)
  4. arrayToDelimitedString(Object[] arr, String delim)
  5. arrayToDelimitedString(Object[] arr, String delim)
  6. arrayToDelimitedString(T[] array, String left, String delimiter, String right)
  7. arrayToReadableString(String[] array)
  8. arrayToTabSeparatedString( final String[] values)
  9. arrayToText(String[] values, String delimiter)