如何取出字符串中的特定字符 比如Label1.Text="第1页";现在要把“第1页”中的1取出来,不知有何方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个东西,不同情况有不同取法,一般都用Substring吧,,好像!~~~ string str = "第1页"; str = str.Substring(1, 1); 我觉得用string.lenth 取出字符串长度,再进行截取。 正则取数字string test = @"第1页"; Regex reg = new Regex(@"(?is)第(?<x>\d+)页");MatchCollection mc = reg.Matches(test);foreach (Match m in mc){ Console.Write(m.Groups["x"].Value);} c#引用问题 菜鸟求助 C# 调DLL,字符串子针的问题 我做一个C#界面,记录员工信息,还要存一张照片,求大神门赐教 C#post提交带有特殊符号的数据老是出错 一个名称空间引用的小问题求教,在线等,100分送上 .net 如何配置不用启动ASP.NET state service服务呢? 欢迎评赏,评点越多,得分越多。 Console.WriteLine输出的东西在即时窗口看不到 急:我想把网站打包成安装文件,然后在别的机上安装,要怎么做啊? 如何刷新datagridview? Crystal Report不分群组可以Show图表吗?
string str = "第1页";
str = str.Substring(1, 1);
string test = @"第1页";
Regex reg = new Regex(@"(?is)第(?<x>\d+)页");
MatchCollection mc = reg.Matches(test);
foreach (Match m in mc)
{
Console.Write(m.Groups["x"].Value);
}