Java Integer Format formatInts(int[] vals)

Here you can find the source of formatInts(int[] vals)

Description

Formats an array of ints.

License

Open Source License

Declaration


public static String formatInts(int[] vals) 

Method Source Code

//package com.java2s;
// The MIT License

public class Main {
    /**//from w ww . jav  a2 s  .  c  om
     * Formats an array of ints.
     */

    public static String formatInts(int[] vals) {
        String res = "";
        if (vals == null)
            res = "(null)";
        else {
            res = "[";
            for (int ii = 0; ii < vals.length; ii++) {
                if (ii > 0)
                    res += " ";
                res += vals[ii];
            }
            res += "]";
        }
        return res;
    }
}

Related

  1. formatIntents(String[] intents)
  2. formatInterval(long interval)
  3. formatIntoHHMMSS(int secsIn)
  4. formatIntoHHMMSS(long l)
  5. formatIntOrLong(long v)
  6. formatIntWithPadding(int value, int length, char pad)