62,046
社区成员
发帖
与我相关
我的任务
分享
string strInput = "bsdg4334j234hg24g23f4g2f34243hfqwehiuyiu2543";
string strOutput=Regex.Replace(strInput, "\\D", "");
string strInput = "bsdg4334j234hg24g23f4g2f34243hfqwehiuyiu2543";
string strOutput=Regex.Replace(strInput, "[^\\d]", "");
string a = "aa1a3bbb45c";
string result = string.Empty;
CharEnumerator ce = a.GetEnumerator();
while (ce.MoveNext())
{
if (char.IsDigit(ce.Current))
result += ce.ToString();
}