Java List to Array toLongList(String str, String splitStr)

Here you can find the source of toLongList(String str, String splitStr)

Description

to Long List

License

Apache License

Declaration

public final static List<Long> toLongList(String str, String splitStr) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

public class Main {

    public final static List<Long> toLongList(String str, String splitStr) {
        if (str != null) {
            ArrayList<Long> longList = new ArrayList<Long>();
            String[] strList = str.split(splitStr);
            for (String string : strList) {
                longList.add(Long.parseLong(string));
            }/*from  ww  w.  j a  va 2 s .  c  o  m*/
            return longList;
        }
        return null;
    }
}

Related

  1. toArray(List from, int[] to)
  2. toArray(List l)
  3. toArray(List list)
  4. toArray(List list)
  5. toArray(List list)
  6. toLongList(String[] array)
  7. toObjectArray(List> lists)
  8. toObjectArray(List list)
  9. toObjectArray(List list)

    HOME | Copyright © www.java2s.com 2016