C#通过正则表达式判断字符是否为数字
int str="121212,1212"
const string pattern = "^[0-9]*$";
Regex rx = new Regex(pattern);
return rx.IsMatch(str); //bool类型
int str="121212,1212"
const string pattern = "^[0-9]*$";
Regex rx = new Regex(pattern);
return rx.IsMatch(str); //bool类型