With all these new .NET things im wondering whats the best way to test if a textbox contains any non-numbers.
The best I came up with was:
Seems like there must be a way to improve on this ?
The best I came up with was:
Visual Basic:
Dim i As Integer = TexBox.Text.Length
Dim ctr As Integer
For ctr = 1 To i
If Asc(TextBox.Text.Chars(ctr - 1)) > 57 Or Asc(sender.Text.Chars(ctr - 1)) < 48 Then
'its not a number
End If
Next
Last edited: