#Enum By Indext
1 messages · Page 1 of 1 (latest)
For both cases you can simply cast them under most conditions.
int index = (int) enumValue;
...
YourEnum enumValue = (YourEnum)index;
You can also index the values field of the enum, though if you specify the values of the enums to be different than their default ordinals the index can be different than the value of the enum.
the indext of the enum start from 0 or start from 1 ?
I'm pretty sure by default the first enum is 0 unless specified otherwise
easy enough to check though, printing out the enum casted to int
ok~ thanks u're awsome
No problem hope it works