What is the best way to create acronym from upper letters in C#?
Example:
Alfa_BetaGameDelta_Epsilon
Expected r
You can use the Where
method to filter out the upper case characters, and the Char.IsUpper
method can be used as a delegate directly without a lambda expression. You can create the resulting string from an array of characters:
string abbreviation = new String(enumTypeName.Where(Char.IsUpper).ToArray());