Java Scanner Usage parse_str_vector(String str_vector)

Here you can find the source of parse_str_vector(String str_vector)

Description

parsstvector

License

Open Source License

Declaration

public static List<Double> parse_str_vector(String str_vector) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static List<Double> parse_str_vector(String str_vector) {
        List<Double> vector = new ArrayList<Double>();

        Scanner scanner = new Scanner(str_vector.substring(1, str_vector.length() - 1));
        scanner.useDelimiter(", ");

        while (scanner.hasNextDouble())
            vector.add(scanner.nextDouble());

        return vector;
    }/*from   w w w .  java 2 s  . c  o m*/
}

Related

  1. nextChar(Scanner s)
  2. nextInt(final Scanner sc)
  3. numberOfLines(String text)
  4. OperasiMasukan()
  5. parameterInput(int start, int end)
  6. parseDailyData(final List lines, final List priceValues, final List dailyPriceDate)
  7. parseExperimentName(String name)
  8. parseQueryString(String queryString)
  9. parseTime(String input)