+ 1
In a switch statement is it possible to use a string variable or can you only use integers (c#)
1 Resposta
+ 6
Yes. You can use strings.
string a = "a";
switch (a)
{
case "a":
a = "bdhdiw";
break;
}
Console.Write(a);
Output: bdhdiw