by Robert Sample » Sun Sep 20, 2015 5:08 pm
1. Count the characters in the word.
2. Find the word in your sentence.
3. Use reference modification (or an array) to move all characters up to your word to your output variable.
4. Use reference modification (or an array) to move all characters after your word to the correct location in your output variable.
If the word can occur more than once in the sentence, and each occurrence is to be deleted, then repeat steps 2 through 4 until you hit the end of the sentence (or at least until the word can no longer occur in the sentence). Key points: use an output variable instead of trying to do it in one variable; you'll need several variables for location and length; and you won't go wrong to run through a couple of examples with paper and pen to make sure you understand what the code is doing.