What is the difference between int.Parse and int.TryParse method?
a) In int.Parse method takes a string as an input and convert it to an integer value. But if sting which we passing not contains the number and it contains other than that it throws an error ArgumentNullException.
b) Int.TryParse method has 2 parameters one is string and other is out parameter. If string is unable to parse it return false flag and this method return type is boolean.
b) Int.TryParse method has 2 parameters one is string and other is out parameter. If string is unable to parse it return false flag and this method return type is boolean.
Comments
Post a Comment