Convert.ToInt32(string); and Int32.Parse(string); produce the same results except when the string is actually a null.
In this case, Int32.Parse(null) throws an ArgumentNullException, but Convert.ToInt32(null) returns a zero.
So which one is better to use?
Waiting for your comments...
In this case, Int32.Parse(null) throws an ArgumentNullException, but Convert.ToInt32(null) returns a zero.
So which one is better to use?
Waiting for your comments...
What about the performance?
ReplyDeletedepend on what i need do i need Zero or no
ReplyDelete