# Null-Conditional Operator

The ?. operator, which accesses a member only when the value is not null.

## What does **Null-Conditional Operator** do in C#?

**Null-Conditional Operator** — The ?. operator, which accesses a member only when the value is not null.

```csharp
class Profile
{
    int? NameLength(string? name)
    {
        return name?.Length;
    }
}
```

Level: Journeyman · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/journeyman)

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/null-conditional-operator
