cast from string to int c# code example
Example 1: how to convert string to int in c#
string a = ("2");
int b = Convert.ToInt16(a)
Example 2: C# convert string to int
int x = Convert.ToInt32("1234");
string a = ("2");
int b = Convert.ToInt16(a)
int x = Convert.ToInt32("1234");