vb.net - Need to catch if a string has a number in it vb -



vb.net - Need to catch if a string has a number in it vb -

i want add together grab statement see if targetword has number inputted it.

console.writeline("enter word want guess: ") targetword = console.readline

if want know if given string contains digits can utilize char.isdigit:

dim input = console.readline() ' example: abc123def dim digits = input.where(addressof char.isdigit) if digits.any() ' ... end if

so if want inquire user new string until enters 1 without digits:

while digits.any() input = console.readline() digits = input.where(addressof char.isdigit) end while

vb.net try-catch

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -