Here you can find the source of splitInput(String cliInput)
Parameter | Description |
---|---|
cliInput | the CLI input |
public static ArrayList<String> splitInput(String cliInput)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { /**// w ww.j a v a 2 s . com * The command line argument separator. */ public static final String SEPARATOR = ","; /** * Splits the input of comma separated command line input and returns the * results as an arraylist. * * @param cliInput the CLI input * * @return an arraylist containing the results, empty list if empty string */ public static ArrayList<String> splitInput(String cliInput) { ArrayList<String> results = new ArrayList<String>(); // empty input, return the empty list if (cliInput == null || cliInput.trim().length() == 0) { return results; } for (String tempInput : cliInput.split(SEPARATOR)) { results.add(tempInput.trim()); } return results; } }