char.IsLetter is using Unicode categories, meaning that it considers much more than just Latin letters to be letters. Also you don’t need to call ToCharArray as String implements IEnumerable<char> and therefore you can apply LINQ directly to strings.
Happily. I never really took the time to learn linq, despite using c# for 8 years. Now, I barely use c#, since most of its features (besides linq) exist in other languages… however, c# will always have a special place in my heart.
View all comments
Show parent comment
8
u/ThatChapThere Jun 05 '22
Most people used Linq rather than hashsets, but that's not a bad solution.