manikandan r

manikandan r

  • NA
  • 358
  • 0

Enum Case ignore or change character case in C# 7

Sep 17 2021 4:40 AM

Is there any way to convert my Enum to Lowercase or ignoring case in C# 7 or above?

 

public enum TV { Sony = 0, Lg = 1 }

public enum myTV { sony = 0, lg = 1}

Switch ( myTV.sony )

{

 case TV.Sony :

Console.WriteLine("Okay");

break;

case TV.Lg :

Console.WriteLine("Not Okay");

break;

}

 


Answers (1)