c# - How can I make a code that will check if a string isn't a number -
the question says all
what tried was
if (textbox1.text != int) { messagebox.show ("this not proper number.") }
i use button start command. new c# excuse such possibly easy
this number , tell if it's not valid. won't throw exception if it's not valid. it'll return false.
int i; if(!int.tryparse("your_string_to_try_and_parse", out i)) { messagebox.show("not number"); }
now drawback tell if it's integer not decimal etc. 5.5 not valid.
Comments
Post a Comment