Java Console Read getCommandArgs(String command)

Here you can find the source of getCommandArgs(String command)

Description

get Command Args

License

Open Source License

Declaration

public static ArrayList<String> getCommandArgs(String command) 

Method Source Code

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

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

public class Main {
    public static ArrayList<String> getCommandArgs(String command) {
        ArrayList<String> list = new ArrayList<String>();
        Scanner scanner = new Scanner(command);
        scanner.useDelimiter(" ");

        while (scanner.hasNext()) {
            list.add(scanner.next());/*  w w  w  . j  ava  2s  .  com*/
        }

        return list;
    }
}

Related

  1. getInScanner()
  2. getUserInput()
  3. getUserInput()
  4. getUserInput(String text, int indentLevel)