62,046
社区成员
发帖
与我相关
我的任务
分享
bool foundMatch = false;
try {
foundMatch = Regex.IsMatch(subjectString, @"^[+-]?\d+(.\d+)?$");
} catch (ArgumentException ex) {
// Syntax error in the regular expression
}
double num;
if(double.TryParse(str,out num)){
}
string message="123fd";
int i=0;
try
{
result = int.Parse(message);//这里如果转换不成功会抛错
return true;
}
catch
{
return false;
}