如何用help substring替换空字符串

时间:2011-08-29 15:38:29

标签: c# .net replace

{adsafi**ClRf**udsaf**ClRf**adsf....EOF**ClRf** }

从上面的字符串中如何替换EOF和}

之间的string.empty

输出:

{adsafi**ClRf**udsaf**ClRf**adsf....EOF }**

1 个答案:

答案 0 :(得分:1)

int lastIndex = input.LastIndexOf("something");
string result = input.Substring(lastIndex);
// or
string result = input.Substring(lastIndex, length);