interviews.dotnetthread.com

↑ Grab this Headline Animator

Friday, April 9, 2010

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

int.Parse is a simple method used to convert string to integer. It throws exception when null or invalid input is provided. Hence it is slow.

int.TryParse does not thow any exception instead we must describe second parameter as out parameter which holds result. And it returns boolean value representing success or failure.

Submit this story to DotNetKicks

No comments:

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles