Android String Array to String Convert arrayToString(String[] array)

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

Description

array To String

Declaration

@SuppressWarnings("unused")
    private static String arrayToString(String[] array) 

Method Source Code

//package com.java2s;

public class Main {
    @SuppressWarnings("unused")
    private static String arrayToString(String[] array) {
        StringBuilder builder = new StringBuilder((array.length * 2) + 1);
        int numProcessed = 0;
        builder.append("[");

        for (String str : array) {
            numProcessed++;//from   w ww . j a  v  a2s  .  c om
            builder.append(str);
            if (numProcessed < array.length)
                builder.append(",");
        }

        builder.append("]");

        return builder.toString();
    }
}

Related

  1. StringArrayToString(List array)
  2. StringArrayToString(String[] array)
  3. getConcatenatedString(String... args)
  4. implode(String[] array, String glue)