I found something in c# that I wanted in a programming language for so long
If (char=='t' || char =='T')
And imagine you have the same check repetitively
Ie add more conditions with char==
Gets verbose
C# has
This
if ((choice is 'T' or 't')) //c# pattern matching
If (char=='t' || char =='T')
And imagine you have the same check repetitively
Ie add more conditions with char==
Gets verbose
C# has
This
if ((choice is 'T' or 't')) //c# pattern matching
Comments