Of interest, is it possible to assume that if Int32.TryParse(String, Int32)it fails, then the int argument will remain unchanged? For example, if I want my whole to have a default value that is wiser?
int type;
if (!int.TryParse(someString, out type))
type = 0;
OR
int type = 0;
int.TryParse(someString, out type);
source
share