In order to convert string to integer, use the Int32.Parse().
The Parse method converts the string representation of a number to its
32-bit signed integer equivalent. If the string contains non-numeric
values, it throws an error.Similarly, you can also convert string to
other types using Boolean.Parse(), Double.Parse(), char.Parse() and so
on.
Example
string str = "12345";
int temp = Int32.Parse(str);
0 comments:
Post a Comment