how to string can be int c# code example
Example 1: parsing string to int c#
string userInput = Console.ReadLine();
int convert;
Int32.TryParse(userInput, out convert); // Converting String to int
Example 2: c# convert string to int
int number;
bool result = int.TryParse("12345", out number);
if(result)
{
// Do whatever.
}
else
{
// Failed to parse.
}