string RegStr = @"^[0-9]*[1-9][0-9]*$"; if (Regex.IsMatch("待验证的字符串", RegStr)) { return true; } else { return false; }
string RegStr = @"^[0-9]*[1-9][0-9]*$"; if (Regex.IsMatch("待验证的字符串", RegStr)) { return true; } else { return false; }
转载于:https://www.cnblogs.com/mtsl/p/4234585.html