Friday, June 22, 2012

Parse and TryParse

Parse
   This function will take a string and convert it and then return the integer.
It will throw FormatException if it cant parse
Throw OverflowException if it is too large
Throw ArgumentException if it is null value

TryParse
   This wont throw any exception. It returns a boolean if it was able to successfully parse a number
ex., int.Tryparse(string, out result).

No comments:

Post a Comment