C# 14 · Records, classes and pattern matching

Define an enum

A named set of constants, and parsing one from text.

enum Status { Draft, Published, Archived }

var status = Enum.Parse<Status>("Published");

Official C# 14 documentation

More records, classes and pattern matching commands

All records, classes and pattern matching commands · C# 14 cheatsheet

Was this page helpful?