Android String Split stringToLongArray(String src, String separator)

Here you can find the source of stringToLongArray(String src, String separator)

Description

string To Long Array

Declaration

public static List<Integer> stringToLongArray(String src,
            String separator) 

Method Source Code

//package com.java2s;

import java.util.ArrayList;

import java.util.List;

public class Main {
    public static List<Integer> stringToLongArray(String src,
            String separator) {/*from  w w  w  .ja va  2  s . c  om*/
        List<Integer> res = new ArrayList<Integer>();
        if (src != null && separator != null) {
            try {
                String[] strArray = src.split(separator);
                if (strArray.length > 0) {
                    for (int i = 0; i < strArray.length; i++) {
                        res.add(Integer.parseInt(strArray[i]));
                    }
                }
            } catch (Exception e) {
            }
        }
        return res;
    }
}

Related

  1. splitSteps(String str, String split)
  2. splitString(String tokenedStr, String token)
  3. explode(String original, String split)
  4. getFirstWord(String str)
  5. getLine(String text, int line)
  6. strToArray(String string)
  7. strToArray(String string, String delim)
  8. getStringArray(String str)
  9. split(String source, String separator, int arraylength)