Java tutorial
//package com.java2s; import java.util.*; public class Main { public static long[] strToArrayOfLong(String str) { StringTokenizer tmpst = new StringTokenizer(str, "|", false); int len = tmpst.countTokens(); long[] retl = new long[len]; for (int i = 0; i < len; i++) { retl[i] = Long.parseLong(tmpst.nextToken()); } return retl; } }