Created
March 23, 2022 20:17
-
-
Save rorywoods/d6486a6cbea6a85bffa49a2e1d1bc932 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int? maybe = 12; | |
if (maybe is int number) | |
{ | |
Console.WriteLine($"The nullable int 'maybe' has the value {number}"); | |
} | |
else | |
{ | |
Console.WriteLine("The nullable int 'maybe' doesn't hold a value"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment