#Development post: C# 7 Series, Part 4:

Posted: 2017/06/27 in Uncategorized

#Development post: C# 7 Series, Part 4: Discards – Sometimes we want to ignore values returned from a method, especially those out arguments, a typical example is to check whether a string can be parsed to another type: bool parsedValue; if (bool.TryParse(“TRUE”, out parsedValue)) { /* Do your stuff */ } Here we want to ignore parsedValue. We also want to make this variable inaccessible so developers cannot reference it. The C# 7.0 has a new feature called discards, whi… http://ow.ly/7CkA50cqE6S

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s