I am looking for list recommendations and getting a related string value. Considering this:
public enum Fruits {
Apple,
Orange,
Grapefruit,
Melon
}
What is the best way to get the associated string value of a name? For instance. "Grapefruit", given that the string value may not correspond to the representation in the listing. for example, "Kasab melon"
My current thinking is a function that takes an enumeration and returns a string, but that does not mean hard coding string values (which I prefer not to do)? Is using a resource file in which a string can be retrieved through an enumeration too heavy?
Jason source
share