You cannot do this .... NET runtime knows nothing about the success or failure of long.TryParse . He only knows that TryParse has a return value of bool and after the TryParse completes, the out variable will be initialized. There is no necessary correlation between true and "there is a good value in result " and false and "there is no good value in result ".
To make it clear, you could:
static bool NotTryParse(string s, out long result) { return !long.TryParse(s, out result); }
And now? When should your default be used?
source share