【发布时间】:2016-10-18 16:03:51
【问题描述】:
假设我有两个字符串:
string s1 = "hello";
string s2 = "hello world";
有没有办法获得string s3 = " world";,这是两个字符串之间的区别?
编辑:
区别总是在这种情况下
s1 = "abc"
s2 = "abcd ads as "
【问题讨论】:
-
您需要更清楚地定义差异。
s1 = "hello!"和s2 = "hello world!"的场景呢?还是s1 = "bob the builder"和s2 = "the bob"?是否总是只包含另一个字符串的确切子字符串? -
更复杂的区别呢……比如,“abc”与“1bC4”