标签: c# enums override tostring
我有一个这样的枚举:
public enum MyEnum { people1, people2 }
我想覆盖或重载ToString()方法。例如,在下一个代码中,变量s变为“This is people 1”
string s=MyEnum.people1.ToString(); //I want to s becomes "This is people 1"
我不想用扩展方法创建另一个方法,我想重写或重载ToString方法。