https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...
Pattern matching is in C# unless I misunderstood you.