Lets say I have two strings:
string s1 = "hello";
string s2 = "hello world";
Is there a way I can get a string s3 = " world"; which is the difference between the 2 strings?
EDIT:
The difference will be always in this scenario
s1 = "abc"
s2 = "abcd ads as "
Use
string s3 = s2.Replace(s1, "");EDIT: Note that all occurrences of
s1ins2will be absent froms3. Make sure to carefully consider the comments on this post to confirm this is your desired result, for example the scenarios mentioned in @mellamokb‘s comment.