public static string Search_string(string s, string s1, string s2) //获取搜索到的数目
{
int n1, n2;
n1 = s.IndexOf(s1, 0) + s1.Length; //开始位置 .
n2 = s.IndexOf(s2, n1); //结束位置
return s.Substring(n1, n2 - n1); //取搜索的条数,用结束的位置-开始的位置,并返回
}
C#一个非常使用的寻找字符串函数
最新推荐文章于 2022-04-21 21:44:38 发布