我要把 字符串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} ARCGIS Server9.2 发布地图服务问题 正则表达式获取标记之间的内容!听说标题要长才会有人来 byte[]引发的血案吗 c# 3DES解密问题 serialport的DataReceived问题 我有两个变量,可C#的switch好像只能输入一个变量,我想用数组,又表达来表达去总是出错,请问达人有什么高招? 如何让dateTimePicker显示的日期推后一天? 水晶报表怎么用啊! C#中如何将定义和实现分离? 可否检测到有多少个连接到sql server数据库的? 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
}