Java String to List stringToList(String str)

Here you can find the source of stringToList(String str)

Description

string To List

License

Apache License

Declaration

public static ArrayList<Double> stringToList(String str) 

Method Source Code

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

import java.util.ArrayList;

public class Main {
    public static ArrayList<Double> stringToList(String str) {
        str = str.substring(1, str.length() - 1);
        String[] sline = str.split(",");
        ArrayList<Double> list = new ArrayList<>();
        for (String s : sline) {
            list.add(Double.parseDouble(s));
        }//from w  w  w.j a v  a  2s  .c o  m
        return list;
    }
}

Related

  1. stringToList(String s)
  2. stringToList(String s)
  3. stringToList(String s)
  4. stringToList(String source)
  5. stringToList(String sText)
  6. stringToList(String str)
  7. stringToList(String str, char delimiter)
  8. stringToList(String str, String delim)
  9. stringToList(String string, String separator)