Here you can find the source of SplitCSV(String csv)
public static ArrayList<Integer> SplitCSV(String csv) throws Exception
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static ArrayList<Integer> SplitCSV(String csv) throws Exception { ArrayList<Integer> list = new ArrayList<Integer>(); // Return empty list if no entries csv = csv.trim();// w w w.j a v a2 s . co m if (csv.length() == 0) { return list; } // Split our our array try { for (String s : csv.split(",")) { s = s.trim(); list.add(Integer.parseInt(s)); } } catch (Exception e) { throw new Exception("List must contain numbers."); } return list; } }