Variables? We Don't Need No Stinking Variables - C# Discards

added by DotNetKicks
3/24/2020 7:19:21 AM

411 Views

C# 7.0 introduced the concept of discards. Discards are intentionally unused, temporarily dummy variables that we don't care about and don't want to use. For example, the following shows the result of an addition being discarded: _ = 1 + 1; Note the underscore _ this is the discard character.


0 comments