Skip to content

Posts

The 5 Different Meanings of the Question Mark in C#

August 5, 2019 • 1 min read

The 5 Different Meanings of the Question Mark in C#

In C# the question mark has 5 meanings as of C# 8.

  1. Ternary operators
(true ? "true": "false")

2. Null conditional operator

items?.Count()

3. Nullable types (this should be rebranded as nullable value types)

int?

4. Null-coalescing operator

isnull ?? string.Empty

5. Nullable reference types

string?

Author: Chuck Conway is an AI Engineer with nearly 30 years of software engineering experience. He builds practical AI systems—content pipelines, infrastructure agents, and tools that solve real problems—and shares what he’s learning along the way. Connect with him on social media: X (@chuckconway) or visit him on YouTube and on SubStack.

↑ Back to top

You may also like