split string value java code example
Example 1: java split string
String yourString = "Hello/Test/World";
String[] strings = yourString.split("/" /*<- Regex */);
Output:
strings = [Hello, Test, World]
Example 2: java string split from input string
String line = scann.nextLine();
String[] info = line.split(" ");
for( String s : info) {
System.out.println(s);
}