Difference between two strings C#

前端 未结 6 1082
小蘑菇
小蘑菇 2020-12-17 10:23

Lets say I have two strings:

string s1 = \"hello\";
string s2 = \"hello world\";

Is there a way I can get a string s3 = \" world\";

6条回答
  •  星月不相逢
    2020-12-17 10:29

    IF (big "if") s1 is always a substring of s2, then you could work with .IndexOf and .Length to find where in s2 that s1 is.

提交回复
热议问题