private List<string> GetEnumNamesCorrected()
{
var correctedNames = new List<string>();
foreach (var enumName in Enum.GetNames(typeof(ManagerType)))
{
var wordsInType =
Regex.Matches(enumName.ToString(), @"([A-Z][a-z]+)")
.Cast<Match>()
.Select(m => m.Value);
var withSpaces = string.Join(" ", wordsInType);
correctedNames.Add(withSpaces);
}
return correctedNames;
} // Outpets new() { "Human Resources", "General Manager" } just converts to string and adds space at Capital letters
public enum ManagerType
{
HumanResources,
GeneralManager
}
private List<string> GetEnumNamesCorrected()
{
var correctedNames = new List<string>();
foreach (var enumName in Enum.GetNames(typeof(ManagerType)))
{
var wordsInType =
Regex.Matches(enumName.ToString(), @"([A-Z][a-z]+)")
.Cast<Match>()
.Select(m => m.Value);
var withSpaces = string.Join(" ", wordsInType);
correctedNames.Add(withSpaces);
}
return correctedNames;
} // Outpets new() { "Human Resources", "General Manager" } just converts to string and adds space at Capital letters
public enum ManagerType
{
HumanResources,
GeneralManager
}