untwisted Posted July 19, 2003 Posted July 19, 2003 Hi, I'm new to C#, and I was wondering how to convert from type string to type int so that I could preform math operations on my variables. Thanks, Brian Quote
*Experts* Volte Posted July 19, 2003 *Experts* Posted July 19, 2003 myNum = Int32.Parse(stringVar);Note that you should put this inside a Try..Catch block, because that will raise an error if the input string is not a valid number. Quote
untwisted Posted July 19, 2003 Author Posted July 19, 2003 AhhH! Much thanks! I knew I had read something about a .toInt or .Parse type method, but I couldn't find the page I had read it on! -Brian Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.