I need help with string

Well, recently I came back to C plus plus, and I was so confused when I started using it again. Anyways, I need to write a program in which the user enters a single string. It is necessary to select one word and replace it with another of the same length, print a new sentence. And then, delete that same word and write a new sentence without that word. If anyone could help I would really appreciate it!.
Normally, to enter a string with multiple words, you can use getline with cin.
https://stackoverflow.com/questions/4825483/code-for-getting-multiple-words-in-a-string-from-user

To try to find a substring within a string, you can use string::find("the substring").
http://www.cplusplus.com/reference/string/string/find/

To replace this word with another word, you can use string::replace(starting_index, length, "replacement string").
https://www.cplusplus.com/reference/string/string/replace/
Or, you could do a for loop yourself and replace one character at a time since it's the same length.
I see, I'll try it out
Topic archived. No new replies allowed.