Wednesday, 15 December 2010

What is the difference between int.Parse and int.TryParse methods?


Parse method throws an exception if the string you are trying to parse is not a valid number where as TryParse returns false and does not throw an exception if parsing fails. Hence TryParse is more efficient than Parse.

No comments:

Post a Comment