C# Code Examples
Learn C# with short, runnable code examples from C# 1 to the latest release. Each card shows the code and its output.
-
#015 C# 8 Range operator
-
#014 C# 8 Assign if null with ??=
-
#013 C# 7 Tuples and deconstruction
-
#012 C# 6 using static
-
#010 C# 8 Switch expressions
-
#008 C# 6 Culture-aware interpolation
-
#007 C# 2 Method groups in LINQ
-
#006 C# 3 Chain lambdas on one delegate
-
#005 C# 15 Union types in C# 15
-
#004 C# 9 Copy a record, change one thing
-
#003 C# 7 Make big numbers readable
-
#002 C# 6 Filter exceptions with when
-
#001 C# 12 Flatten a collection of collections