Erasing part of the string


lets say string abc = "1000 11 1100"

How can I actually erase 11 from the string, without using string.erase since it requires position. And I don't want it to erase 11 in 1100 only 11 which is followed by a space!

Thanks in advance.
I would recommend using a combination of string.find_first_of and string.erase to accomplish what you want. However, if this does not meet your requirements then you would probably need to implement your own method which uses custom logic to find the occurrence of the pattern you are looking for.
Topic archived. No new replies allowed.