Tutorial by Examples

3.0 The => operator has the same precedence as the assignment operator = and is right-associative. It is used to declare lambda expressions and also it is widely used with LINQ Queries: string[] words = { "cherry", "apple", "blueberry" }; int shortestWordLength...
The assignment operator = sets thr left hand operand's value to the value of right hand operand, and return that value: int a = 3; // assigns value 3 to variable a int b = a = 5; // first assigns value 5 to variable a, then does the same for variable b Console.WriteLine(a = 3 + 4); // prints ...
The Null-Coalescing operator ?? will return the left-hand side when not null. If it is null, it will return the right-hand side. object foo = null; object bar = new object(); var c = foo ?? bar; //c will be bar since foo was null The ?? operator can be chained which allows the removal of if...

Page 2 of 2