Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static ArrayList<Long> getArrayListOfLongFromString(String src, String separator) { ArrayList<Long> result = new ArrayList<Long>(); String[] strNumbers = src.split(separator); for (String str : strNumbers) { result.add(new Long(str)); } return result; } }