Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static double[] parseDoubleArrayFromHeader(String lineFromHeader) {
        lineFromHeader = lineFromHeader.replaceAll(",$", "");
        lineFromHeader = lineFromHeader.trim();
        String[] splitLine = lineFromHeader.split("\\s*,\\s*");

        double[] doubles = new double[splitLine.length];
        for (int i = 0; i < doubles.length; i++) {
            doubles[i] = Double.parseDouble(splitLine[i]);
        }

        return doubles;
    }
}