Answer to Question #797 in C# for Arthur

Question #797
Can we use [b]switch[/b] operator for strings?
1
Expert's answer
2010-10-18T12:22:40-0400
Yes, the operator switch can be used with string variables and any integers.
The sample program would be

string command;
..........................
switch(command)
{
case "Mean"
{
.........
break;
}
case "Max"
{
............
break;
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS