using System; // Namespace which we are importing
namespace String
{
class Program
{
static void Main()
{
Console.WriteLine("Enter your input"); //Here User will enter value
string str = Console.ReadLine(); // In str,value will be stored
int result = 0; // Initializing value to result variable
if (int.TryParse(str, out result))
{
Console.WriteLine("{0} is a number", result);
}
else
{
Console.WriteLine("{0} is not a number", str);
}
Console.ReadLine();
}
}
}This code snippet for check User Input is a String or an Integer.
