mlarrubia
12/6/2018 - 3:08 PM

Strings - Understanding Strings

public static void main(String[] args) {

        String word = "10 Things I Hate About You";
        // ["10", "Things", "I", "Hate", "About", "You"]
        String splitWord[] = word.split("\\s");
        for (int i = 0; i < splitWord.length; i++) {
            System.out.println(splitWord[i]);
        }
    }