We Connect Things To The Internet... That Can't Be Plugged In.
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
This topic
This board
Entire forum
News:
mcCloud is coming soon!!!!
Home
Search
Login
Register
mc-Products
»
mc-Studio
»
ToInteger does not work for Strings
« previous
next »
Print
Pages: [
1
]
Author
Topic: ToInteger does not work for Strings (Read 136 times)
ashesman
Newbie
Posts: 12
ToInteger does not work for Strings
«
on:
February 16, 2017, 05:50:00 pm »
Doesn't work.... Get "Undefined function, indexer or variable or not visible" for ToInteger
Dim someString As String = "123"
Dim someInt As Integer
someInt = someString.ToInteger
Logged
mc-Josh
Global Moderator
Newbie
Posts: 27
Re: ToInteger does not work for Strings
«
Reply #1
on:
February 16, 2017, 06:49:08 pm »
You need to use:
Integer.TryConvert(someString, someInt)
This will convert the string and pass it to the integer. If it fails to convert it returns false.
Logged
Print
Pages: [
1
]
« previous
next »
mc-Products
»
mc-Studio
»
ToInteger does not work for Strings