用于从字符串中删除char序列的String方法

1 c# string

如果我有:

string st1 = "this.is.a.string.type";
string st2 = "string";
Run Code Online (Sandbox Code Playgroud)

如果在st1中存在确切的字符序列,是否有内置的String方法从st1中删除st2?所以我想最终得到"this.is.a..type".

ope*_*lar 5

最简单的是:

st1 = st1.Replace(st2, "");
Run Code Online (Sandbox Code Playgroud)

但这不一定非常有效.