0

With an enum like say:

public enum Authors
{
  KirkPatrick,
  JasmineLliki,
  NatashaKakuvi
}

Now using this helper method I can easily get the corresponding List<string> values:

public class EnumHelper<T> where T : Enum
{
    public static List<string> ToList() => Enum.GetNames(typeof(T)).ToList();
}

My desired output would be something like:

new List<string>() {"Kirk Patrick", "Jasmine Lliki", "Natasha Kakuvi"};

instead of

new List<string>() {"KirkPatrick", "JasmineLliki", "NatashaKakuvi"};

that the method outputs.

Kirk
  • 25
  • 5

1 Answers1

0

It seems that you are trying to, effectively, assign string values to Enums. If that is your intention, check out this StackOverflow question, may be one of the cases there will be helpful.

If you want to proceed with your current Enums instead, you can try using answers from this question to add spaces in a string with capital letters.

MonstraG
  • 180
  • 2
  • 7