Skip to content

Instantly share code, notes, and snippets.

@a-patel
Last active July 14, 2023 11:34
Show Gist options
  • Save a-patel/830da50328f40d209fd35372e58e70ab to your computer and use it in GitHub Desktop.
Save a-patel/830da50328f40d209fd35372e58e70ab to your computer and use it in GitHub Desktop.
C#.NET - Null Forgiving or Null Suppression Operator (!.) Example
/* Example-1 */
// Without null forgiving or null suppression operator
string name = null; // WARNING
// With null forgiving or null suppression operator
string name = null!; // NO WARNING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment