Filtrage par motif (Pattern Matching)
Le filtrage par motif est un moyen de tester des expressions et d'effectuer des actions si le test réussit.
Motif d'expression Switch
csharp string resultat = obj switch { int i => $"C'est un entier : {i}", string s => $"C'est une chaîne : {s}", _ => "Type inconnu" };