I only want to remove a value.. I don\'t need to use the variable afterwards. Why not include an overload where this second parameter was not required?
Do I really h
C#7 added discard syntactic sugar
So now you can write:
dictionary.TryRemove(entry.Key, out _);
Reference
We allow "discards" as out parameters as well, in the form of a _, to let you ignore out parameters you don’t care about: p.GetCoordinates(out var x, out _); // I only care about x
We allow "discards" as out parameters as well, in the form of a _, to let you ignore out parameters you don’t care about:
p.GetCoordinates(out var x, out _); // I only care about x