Java Long Number Array to String longArrayAsString(long[] a)

Here you can find the source of longArrayAsString(long[] a)

Description

long Array As String

License

Open Source License

Declaration

public static String longArrayAsString(long[] a) 

Method Source Code

//package com.java2s;
/*/* w w w.  java2  s.  c o  m*/
 * (C) Copyright IBM Corp. 2008
 *
 * LICENSE: Eclipse Public License v1.0
 * http://www.eclipse.org/legal/epl-v10.html
 */

public class Main {
    public static String longArrayAsString(long[] a) {
        if (null == a)
            return null;
        int len = a.length;
        StringBuffer pcs = new StringBuffer(0 < len ? "[" + a[0] : "[");
        for (int i = 1; i < len; i++)
            pcs.append(", " + a[i]);
        pcs.append(']');
        return pcs.toString();
    }
}

Related

  1. convertLongArrayToString(Long[] longArray)
  2. convertLongArrayToString(long[] value, String separator)
  3. longArrayToString(int startIndex, long[] chars)
  4. longArrayToString(long[] longs)