Java Integer Array to String arrayIntsToString(int... lst)

Here you can find the source of arrayIntsToString(int... lst)

Description

Convert an array of ints into a comma-separated string.

License

Open Source License

Parameter

Parameter Description
lst a parameter

Declaration

public static String arrayIntsToString(int... lst) 

Method Source Code

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

public class Main {
    /**//from ww  w.  j  a  v a  2 s. c o m
     * Convert an array of ints into a comma-separated string.
     * @param lst 
     * @return
     */
    public static String arrayIntsToString(int... lst) {
        String toReturn = "";

        for (int i = 0; i < lst.length; i++) {
            toReturn = toReturn + Integer.toString(lst[i]) + ",";
        }

        return toReturn.subSequence(0, toReturn.length() - 1).toString();
    }
}

Related

  1. arrayIntToString(int[] arrayInt)
  2. convertIntArrayToString(int[] data)
  3. convertIntArrayToString(int[] data)
  4. convertIntArrayToString(int[] value, String separator)