"Null-Conditional Operator"

static void PrintUserName(UserDetails? user) {
	Console.WriteLine($"Name: {user?.Name ?? "No name"}, Age: {user?.Age.ToString() ?? "No age"}");
}

static void Test() {
	PrintUserName(new UserDetails("Ben", 30)); // Prints "Name: Ben, Age: 30"
	PrintUserName(null); // Prints "Name: No name, Age: No age"
}


Code snippet taken from "Two Decades of C#: A Reference - C# 5 and C# 6".