Hi everyone! I was doing programming and ran into this assignment. It says: create a "textbox1" to let the user enter a sentence. Then create a "textbox2" to let the user enter the text they want to remove. Then create a "textbox3" to let the user enter the word they want to replace.
For example, I enter "I love cookies very much" in "textbox1".
For "textbox2", I enter "cookies".
For "textbox3", I enter "eggs".
The label should then display "I love eggs very much" (the word "cookies" is replaced by the word "egg")
How can I do this? The sentence entered may have different length. So how can I locate the word that the user wants to remove. For this particular sentence, I can use "IndexOf("cookies") to locate the word "cookies". But if the user enter a different sentence, then "IndexOf(...what??...)
That's where i struggle.
And furthermore, how can I locate the "full" word. IndexOf only gives me the # of the first letter in that word. How can i locate where the word ends.
Anyone please help me. Thank you very much for your time.