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#一个非常使用的寻找字符串函数
字符串搜索实现
最新推荐文章于 2023-05-25 11:50:42 发布
6503

被折叠的 条评论
为什么被折叠?



