我要把 字符串AABED1234 中的数字提取出来,怎么办? 我要把 字符串AABED1234 中的数字提取出来,怎么办? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Public string GetNum(string ss){ string s = ss; string sNum = ""; for (int i = 0; i < s.Length; i++) { char c = s[i]; if (c>=48 && c<=57) { sNum += c; } } return sNum;} try { Regex RegexObj = new Regex("\\d"); Match MatchResults = RegexObj.Match(SubjectString); while (MatchResults.Success) { MatchResults = MatchResults.NextMatch(); } } catch (ArgumentException ex) { // Syntax error in the regular expression} 请教大家 c# adox access问题 关于C#中的字符串提取函数,如何提取c:\\data\name.dat中的name.dat文件名? 新手求助 C# 下拉菜单 用vc#做的邮件发送代码不起作用,高手帮我看看!!谢谢了!! 进制转换问题救助 高分求cookie解决方法! 新手问最简单的问题 用c#做了个浏览器,却无法显示网页里的java小程序 VS2010 C# listview 显示数据时有时无 gridview调用问题!!!!!!!!!!!!!!!!!!!!!!!!!!!1 C#是否实现边录音边放音的功能?
Public string GetNum(string ss)
{
string s = ss;
string sNum = "";
for (int i = 0; i < s.Length; i++)
{
char c = s[i];
if (c>=48 && c<=57)
{
sNum += c;
}
}
return sNum;
}
Regex RegexObj = new Regex("\\d");
Match MatchResults = RegexObj.Match(SubjectString);
while (MatchResults.Success) {
MatchResults = MatchResults.NextMatch();
}
} catch (ArgumentException ex) {
// Syntax error in the regular expression
}