c# - TryParse: which value is set in case of error? -


the signature of tryparse method int (others same) following:

public static bool tryparse(string s, out int result) 

where "out" means result must initialized in case parsing not successful. documented values tryparse(s) set variables in case of unsuccessful parsing?

i need initialize values parsed values or default values in case of unsuccessful parsing, in case of guaranteed default values don't need check result.

is documented values tryparse(s) set variables in case of unsuccessful parsing?

yes, it's documented.

result
when method returns, contains 32-bit signed integer value equivalent number contained in s, if conversion succeeded, or 0 if conversion failed.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -