Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Welcome!
Peglo
1
9
10
11
12
16
// {
int? a = null;
Console.WriteLine(a ?? 5);
// Equivalent ternary : a != null ? a : 5
// {
Enter to Rename, Shift+Enter to Preview
Description
The ?? operator allows you to assign the variable if it is not null otherwise it assigns the right value.
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content