Try:
For Each c As Char In value
Dim i As Integer = -1
If Not (Int32.TryParse(c, i) AndAlso i >= 0 AndAlso i <= 7) Then
[UPDATE]
If you don't want to split the value into seperate chars, try this:
Dim i As Integer = -1
If Not (Int32.TryParse(value, i) AndAlso i >= 0 AndAlso i <= 7) Then
If you use this code, DON'T use a
For Each
loop!