String a = "some phrase"; String[] b = a.split(" "); for (String s : b) { System.out.println("String part: " + s); }