Functions to capitalize the first letter of every word in a string and count the number of words in a string