Support > Forums > OpenBots Studio > Convert string to Int
Hello OpenBots community,
I try to convert a variable string "1234" in a numeric variable but i dont find the right documentation about it. I need to convert it to check if the variable is greater than 0
Does someone have an idea ?
Thanks
This forum has 313 topics, 680 replies, and was last updated 16 days ago by Faheem Syed
Hi, Thankyou for sharing the query. Thankyou for sharing the resolution as well and I hope it will be useful for others. To add up to your resolution -
We can make conversions to either Int64 or Int16 as well by replacing Int32. and output create a number variable and assign it.
Ok I have fund a solution to convert String to Int and in reverse Int to String :
So to convert String to Int :
//String
myVariable = "1234"
//To Int
Int32.Parse(myVariable)
To convert Int to String : Important don't forget the parenthesis : ()
//Int
myVariable = 1234
//To String
myVariable.ToString()
You are not authorized to reply, please click here to login and add your reply to this topic.