String to Integer?
Visual Basic
3
Posts
3
Posters
0
Views
1
Watching
-
In my program I want the user to write in a TextBox. Then I want to check if the input contains only a numerical value. How can I do this? //OT
-
In my program I want the user to write in a TextBox. Then I want to check if the input contains only a numerical value. How can I do this? //OT
If you want to convert a string to an int use Int32.Parse(mystring). If you want to validate input (requiring numeric values only, for instance) use regular expressions.
-
In my program I want the user to write in a TextBox. Then I want to check if the input contains only a numerical value. How can I do this? //OT
Just something like this will work:
If IsNumeric(Textbox1.Text) Then ' Value entered is a number End If