C# 截取指定的字符串

 string s = "1234abc123444555efcdeeee";
            int i = s.IndexOf("abc")+1;
            int j = s.IndexOf("ef");

            string str = s.Substring(i, j - i+2);

int i = s.IndexOf("abc");
str结果为:abc123444555ef

猜你喜欢

转载自blog.csdn.net/qq_40267217/article/details/80470636
今日推荐