vb.net - Convert string to integer with CINT -
vb.net - Convert string to integer with CINT -
const gconintrows1st integer = 15 const gconintrows4th integer = 20
i trying convert string integer
by using:
intnumber = cint(strnumberselected(intfirst5balls))
professor's
inttemperature = cint(strtemperatures(intmonth))
but how not work.
the professor's version worked fine cannot figure out why intnumber not.
yes, first time doing vb
it looks strnumberselected string array, correct? , you're asking string in array @ position intfirst5balls?
take example:
dim strarray string() = split("hi|there|everybody", "|")
the split() function split our long string @ each occurrence of pipe ("|").
the resulting string array have next 3 elements:
"hi" "there" "everybody"
and you'd reference these elements indexes:
strarray(0) = "hi" strarray(1) = "there" strarray(2) = "everybody"
if you're getting error 'char' values cannot converted 'integer' array more array of type char, , cint() function cannot convert integer.
you can utilize
integer.tryparse()
to seek valid integer array, sounds bit you're unsure sort of info lives in array.
vb.net
Comments
Post a Comment