How to get certain arguments from a string?

This is what I need:

String s = "arg1 arg2 arg3 arg4"; System.out.printIn("Аргумент в строчке s = " s.getArg(4)); 

How to do it?

  • four
    String [] args = s.split (""); System.out.printIn ("Argument at s =" + args [3]); - TimurVI
  • one
    If you put your code in questions and not links to other resources, the chances of getting an answer will be higher. - m. vokhm

0