Converting String to int in C#

If you want to convert String to int under C#, two ways are the most common:

using convert, as in intVal = Convert.ToInt32(strval);

or, using parse as in intVal = Int32.Parse(“1234”);

Leave a Reply

You must be logged in to post a comment.