Intel Corporation interview question

Counting words in a string.