1

I have an enum like this:

public enum MyEnum
{
    people1,
    people2
}

I want to override or overload ToString() method. For example in the following code, variable s becomes "This is people 1".

string s=MyEnum.people1.ToString(); //I want s to become "This is people 1"

I don't want to create another method with extension method, I want to override or overload ToString method.

Palle Due
  • 5,929
  • 4
  • 17
  • 32
mohammad
  • 1,248
  • 3
  • 15
  • 27

0 Answers0