string number = "-1.234"; double test = 0; if (double.TryParse(number,out test) && test >= 0) MessageBox.Show("Yes"); else MessageBox.Show("No");
true
int
double
false
TryParse
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)