【发布时间】:2017-04-02 17:34:08
【问题描述】:
我已经对应用程序进行了很长时间的性能分析
原来大部分CPU都被IndexOf函数占用了
这里是函数
public static string func_Fix_Google_Source(string srSource)
{
int irIndex = srSource.IndexOf("<div id=\"gt-form-c\">");
return srSource.Substring(irIndex);
}
字符串的长度很重要吗?我相信我可能会缩短搜索字符串的长度
【问题讨论】:
标签: c# .net performance indexof .net-4.6.2