# is Pattern

An is expression that tests a value against a type or another pattern.

## What is **is Pattern** in C#?

**is Pattern** — An is expression that tests a value against a type or another pattern.

```csharp
class LabelReader
{
    int LengthOf(object value)
    {
        if (value is string text)
        {
            return text.Length;
        }

        return 0;
    }
}
```

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/is-pattern
