You can create a scanner object to operate on your string, then simply use the next() method to get words separated by whitespaces.