I just found this: The ?? operator aka the Null Coalescing Operator
You also have it in C/C++ as a GNU extension using the
?:
operator :string pageTitle = getTitle() ?: "Default Title";
More Related Contents:
- Unique ways to use the null coalescing operator [closed]
- What is the operator precedence of C# null-coalescing (??) operator?
- What do two question marks together mean in C#?
- Unable to cast object of type ‘System.DBNull’ to type ‘System.String`
- Unity: Null while making new class instance
- What is the difference between null and System.DBNull.Value?
- Setting Objects to Null/Nothing after use in .NET
- C# okay with comparing value types to null
- What is the difference between Nullable.HasValue or Nullable != null?
- Deep null checking, is there a better way?
- DateTime “null” value
- What is the difference between “x is null” and “x == null”?
- Json Convert empty string instead of null
- C#: Passing null to overloaded method – which method is called?
- In C#, what happens when you call an extension method on a null object?
- What is the “??” operator for? [duplicate]
- How to set enum to null
- How do I handle null or optional DLL struct parameters
- C#: should object variables be assigned to null?
- Easier way of writing null or empty?
- An expression tree lambda may not contain a null propagating operator
- How am I misusing the null-coalescing operator? Is this evaluating “null” correctly?
- Curious null-coalescing operator custom implicit conversion behaviour
- Best way to check if a Data Table has a null value in it
- Check for null in foreach loop
- DateTime “null” / uninitialized value?
- ?? Null Coalescing Operator –> What does coalescing mean?
- Why does null need an explicit type cast here? [duplicate]
- What does exclamation mark mean before invoking a method in C# 8.0? [duplicate]
- Null-coalescing operator returning null for properties of dynamic objects