Results (same as stest1.java despite the inserted tab characters)
C:ece538\stest>java stest4 the music made it hard to concentrate
stest4.java
public class stest4 {
public static void main(String [] args) {
String phrase = "the music made \t it hard to \t\t concentrate";
String delims = "[\\s]+";
String[] tokens = phrase.split(delims);
for (String tok: tokens)
System.out.println(tok);
}
}
Maintained by John Loomis, updated Tue Jan 30 17:35:19 2018