當前位置:歷史故事大全網 - 歷史天氣 - C#删除之前指定文本

C#删除之前指定文本

public string cutString(string sourceText, string splitUnit)

{

int x = sourceText.LastIndexOf(splitUnit);

if (-1 = = x)

返回sourceText;

否则

返回sourceText.Substring(x 1,sourceText.Length - x-1);

}

  • 上一篇:變壓器怎麽測量
  • 下一篇:为什么要用“爬”字呢? ──《爬天都峰》教学案例
  • copyright 2024歷史故事大全網