Here you can find the source of readColumn(int columnIndex, String inputString, String columnSeparator)
public static List<String> readColumn(int columnIndex, String inputString, String columnSeparator)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> readColumn(int columnIndex, String inputString, String columnSeparator) { List<String> columnValues = new ArrayList<String>(); for (String line : inputString.split(System.getProperty("line.separator"))) { String[] columns = line.split(columnSeparator); if (columnIndex < columns.length) { columnValues.add(columns[columnIndex]); }//from w w w . j a v a 2 s .c o m } return columnValues; } }