First page Back Continue Last page Graphics
TAKING STRINGS APART (cont.)
Take a string as input.
Return a vector<string> containing all the words.
Strings support indexing.
Suppose you had a string s of at least one character.
- s[0] = the first character of s.
- s[s.size( ) - 1] is the last character of s.
We'll use two indices to point to the start of a word and the space following it.