It’s very easy I have the following Enum
Public Enum TCheckStatus
Checked
NotChecked
Indeterminate
End Enum
I want to get the Index of the given name found in the enum, what’s the best way?!!
For Example:
Suppose I have “NotChecked” string , I want the output to be 1
You are looking for Enum.GetNames. It retrieves an array of the names of the constants in a specified enumeration.
stringvariable to an enum-valueArrayArrayOf course to solve your question you only need this: