Here you can find the source of arrayToList(int[] intArr, int cnt)
public static String arrayToList(int[] intArr, int cnt)
//package com.java2s; //License from project: Open Source License public class Main { public static String arrayToList(int[] intArr, int cnt) { return arrayToList(intArr, 0, cnt); }/*from ww w.j a va2 s. com*/ public static String arrayToList(int[] intArr, int start, int cnt) { if (start < 0) { start = 0; } if (cnt < 1) { return ""; } int fullCnt = start + cnt; fullCnt = (fullCnt < intArr.length) ? fullCnt : intArr.length; String strList = ""; strList = "" + intArr[start]; for (int i = 1; i < cnt; i++) { strList += "," + intArr[start + i]; } return strList; } }