Here you can find the source of splitStringToLong(String strInput, String separator)
Parameter | Description |
---|---|
strInput | a parameter |
separator | a parameter |
public static List<Long> splitStringToLong(String strInput, String separator)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**/*from w w w .j ava 2 s .c om*/ * Split String to List of long by separator * @param strInput * @param separator * @return */ public static List<Long> splitStringToLong(String strInput, String separator) { List<Long> lstResult = new ArrayList<Long>(); if (strInput != null && !strInput.isEmpty()) { String[] strTemp = strInput.split(separator); if (strTemp != null && strTemp.length > 0) { for (int i = 0; i < strTemp.length; i++) { lstResult.add(Long.valueOf(strTemp[i])); } } return lstResult; } return null; } }