homework help/ String Searcher
Here is my assignment:
This program asks for a sentence and a search word. It prints the number of times the search word appears exactly in the sentence, and the number of times the search word appears as part of another word.
An example would be "Madam, I'm Adam" search word: adam.
So far I've written the program so that it asks the user for the sentence and search word, and then converts everything to lower case. I'm having trouble with the counts though. I've been looking through the Lang book and have found a letter counter and trying to see if I can manipulate it to look like my search word instead, but so far have failed.
Does anyone know how to count the number of times the word appears exactly and as part of another word? I'm hoping to get this finished for tomorrow morning.