I want to receive something from WriteLine and associate a variable and after verify is what the user write is a int.
i have this
Console.WriteLine("Idade:");
int idade2 = Convert.ToInt32(Console.ReadLine());
if (???)
{
Console.WriteLine("Insira um número não uma string:");
}
else
{
pessoa.idade = idade2;
}
i see some stuff in other post internet etc about int.TryParse ( variavel_string, out variavel_int) but for me dont make sense and i dont think i need it.
in other language is very simple isnumeric(variable) and works in c# i dont know what to do.
What i need put in if condition to work?