Int32 result = -1;
if (Int32.TryParse("210s", out result))
{
// Parsing succeeds, now you can safely use the value.
}
else
{
// Parsing fails, this route is faster.
}
Int32 result = -1;
try
{
result = Int32.Parse("210s")
}
catch(Exception)
{
// Parsing fails, this route is slower.
}