Basically a series of titles will be passed into the switch statement and I need to compare them against the string values of the enum. But I have little to no idea how to do this correctly.
Also, I don’t know if this is even the best approach so if anyone has any ideas?
For example:
enum
{
doctor = "doctor",
mr = "mr",
mrs = "mrs"
}
and then switch through the string values I’ve assigned them.
You can’t have an
enumwith an underlying type ofstring. The underlying type can be any integral type exceptchar.If you want to translate a
stringto yourenumthen you’ll probably need to use theParseorTryParsemethods.