当前位置: 首页 > 资讯 > >正文

CCTV5今天节目表(C)

来源:互联网    时间:2023-07-29 17:39:19

1、下面给你两种办法

2、方法一:

3、Regex reg = new Regex(@"([a-zA-Z]+)\d+([a-zA-Z]+)\d+([a-zA-Z]+)");


(相关资料图)

4、 string text = "aaa111bbb111ccc111dddd";

5、 if (reg.IsMatch(text))

6、 {

7、 GroupCollection regGroup = reg.Match(text).Groups;

8、 foreach (Group item in regGroup)

9、 {

10、 Response.Write(item.Value);

11、 Response.Write("
");

12、 }

13、 }

14、 Response.Write("..................");

15、方法二:

16、 string[] t = text.Replace("111", "|").Split("|");

17、 foreach (string item in t)

18、 {

19、 Response.Write(item);

20、 Response.Write("
");

21、 }

本文到此讲解完毕了,希望对大家有帮助。

X 关闭

推荐内容

最近更新

Copyright ©  2015-2022 海峡办公网版权所有  备案号:皖ICP备2022009963号-10   联系邮箱:396 029 142 @qq.com