Deleting substring(s) from a string

Hi there.
I have a school project to make my own pseudo string class and one of the overloaded operators has to be a unary minus, which is to remove all of the given substrings from a given string. Lets say we have:

String 1 = somethingsomething;
String 2 = some;
String 3 = String 1 - String 2;
***String 3 = thingthing***

What would be the best way to implement such a function?
Thanks in advance.
How would you do it if the strings were letters written in little squares on a sheet of squared paper on a table?

Like that.

This is programming. Thinking about how to solve problems using the tools you have.
I am not saying that I have totally no ideas on how to do this, I am asking for the most optimal way, an idea maybe. Not an actual code itself.
Compare letters in main string with letters in substring to find a match. When match found, replace all letters in main string with the letter (size of substring ) places to the right.
Topic archived. No new replies allowed.