import java.util.Scanner; public class MainClass { public static void main(String[] argv) { String scanMe = "abc123d123ef123gh123ij123kl"; String delim = "\\s"; Scanner scanner = new Scanner(scanMe); scanner.useDelimiter(delim); while (scanner.hasNext()) System.out.println(scanner.next()); } }
abc123d123ef123gh123ij123kl