How do I use the TryParse method within a Predicate? TryParse requires an out parameter. In the example below, I would like to call TryParse to determine if x can be converted to an integer. I really don’t care for the out parameter–I just want to get this to compile.
string[] nums = num.Split('.');
PexAssume.TrueForAll(nums, x => int.TryParse(x, out (int)0));
The “expression” part of a lambda can be wrapped in braces, allowing a full function body with multiple statements. So long as the result of that body is the same as the return value of the implied function you are implementing, you can do whatever you need to do between those braces.