📜  如何从java代码示例中的输入字符串中获取单个值

📅  最后修改于: 2022-03-11 14:52:10.992000             🧑  作者: Mango

代码示例1
public static void main(String[] args) {
    // TODO Auto-generated method stub

    Scanner reader = new Scanner(System.in);

    System.out.print("Enter the strings > ");
    String s1 = new String(reader.nextLine());

    String[] str = s1.split(" ");

    for(int i=1;i