Hello!
It seems to me that both Int32.Parse(..) and Convert.ToInt32 (...) static
methods works in exactly the same way.
Both can throw an exeption.
So is it any different at all between these two ?
string input1 = Console.ReadLin e();
string input2 = Console.ReadLin e();
try
{
int number1 = Convert.ToInt32 (input1);
int number2 = int32.Parse(inp ut2);
}
catch
{...}
//Tony
It seems to me that both Int32.Parse(..) and Convert.ToInt32 (...) static
methods works in exactly the same way.
Both can throw an exeption.
So is it any different at all between these two ?
string input1 = Console.ReadLin e();
string input2 = Console.ReadLin e();
try
{
int number1 = Convert.ToInt32 (input1);
int number2 = int32.Parse(inp ut2);
}
catch
{...}
//Tony
Comment