public enum VehicleData { Dodge = 15001, BMW = 15002, Toyota = 15003 }
I want to get the values ββ15001, 15002, 15003 in an array of strings, as shown below:
string[] arr = { "15001", "15002", "15003" };
I tried the command below, but this gave me an array of names instead of values.
string[] aaa = (string[]) Enum.GetNames(typeof(VehicleData));
I also tried string[] aaa = (string[]) Enum.GetValues(typeof(VehicleData)); but that didn't work either.
Any suggestions?
source share