Java Array to String arrayToString(final String[] value)

Here you can find the source of arrayToString(final String[] value)

Description

Converts a String[] to a single String

License

Open Source License

Parameter

Parameter Description
value the String[] to convert

Return

the contents of value concatenated, with "*" as separator

Declaration

private static String arrayToString(final String[] value) 

Method Source Code

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

public class Main {
    /**// w  w  w.  jav a2  s. co m
     * Converts a String[] to a single String
     *
     * @param value the String[] to convert
     * @return the contents of <code>value</code> concatenated, with "<code>*</code>" as separator
     */
    private static String arrayToString(final String[] value) {
        if (value == null || value.length == 0)
            return "";
        StringBuilder buff = new StringBuilder(value[0]);
        for (int i = 1; i < value.length; ++i)
            buff.append("*").append(value[i]);
        return buff.toString();
    }
}

Related

  1. arrayToString(final Object[] arr)
  2. arrayToString(final Object[] array)
  3. arrayToString(final Object[] array)
  4. arrayToString(final String[] args)
  5. arrayToString(final String[] strs)
  6. arrayToString(final String[] values)
  7. arrayToString(final T... data)
  8. arrayToString(final T[] array)
  9. arrayToString(float[] a)