How to use variable in case statement?

  • Thread starter Thread starter Brett Romero
  • Start date Start date
B

Brett Romero

I have this:
case MyXML.RootAttribute


which is defined in a static class as:
public const string RootAttribute = "ROOT";

The above case doesn't hit until I use:
case "ROOT"

is there a way to keep from hard coding the text?

Thanks,
Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top