bool success = Int32.TryParse(value, out number);
if (success)
{
Console.WriteLine("Converted '{0}' to {1}.", value, number);
}
bool successfullyParsed = int.TryParse(str, out ignoreMe);
if (successfullyParsed){
// ...
}
bool successfullyParsed = int.TryParse(str, out ignoreMe);
if (successfullyParsed){
// ...
}