当前位置: 代码迷 >> ASP.NET >> 怎样截取中文中的数字字符?解决方案
  详细解决方案

怎样截取中文中的数字字符?解决方案

热度:5011   发布时间:2013-02-25 00:00:00.0
怎样截取中文中的数字字符?
如下:
火影忍者239.rmvb
隋唐英雄传25.rmvb

像这样的电影名称,我需要把其中的数字字符截取出来,然后显示
如:239,25   这样的数字

请问怎么截取??

------解决方案--------------------------------------------------------
string str = "火影忍者239.rmvb "; System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(@ "(\d+?)\. "); System.Text.RegularExpressions.Match m = reg.Match(str); if (m.Success) { Response.Write(m.Result( "$1 ")); }
------解决方案--------------------------------------------------------
try ->

string str = "火影忍者239.rmvb ";
string num = Regex.Match(str, @ "\d+ ").Value;
  相关解决方案