Is swich can take string parameter yes or no like

string s="Mo";
case "sa ":
break ;
case "jv":
default :


this is what says:

A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer.

If you use static strings in your switch, then you may think to enumerate them.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.