Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;

public class Main {
    /**
     * Get an ArrayList from a String of comma separated values 
     * 
     * @param  csvStr  comma separated values
     * @return ArrayList ArrayList of the values
     */
    public static ArrayList<String> getListFromCsvString(String csvStr) {
        ArrayList<String> arrList = new ArrayList<String>();
        for (String x : csvStr.split(",")) {
            x = x.trim();
            arrList.add(x);
        }
        return arrList;
    }
}