954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Switch Case Options

Hi If i have switch statement look like this and after getting or display function or by entering wrong character(default) how can i go to same screen which will display different options. As i know there are goto statements but that is not recommended? So please can anybody recommend me what to use or to do?

switch (s)
            {
                case "g":
                uname.getUserName();
                break;
    
                case "v":
                uname.DisplayUserName();
                break;
               
                default:
                Console.WriteLine("Please select correct choice...");

Thnx,
Regards,

shsh_shah
Light Poster
29 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

Thanks for viewing :)
I have sorted out the problem. Thanks

shsh_shah
Light Poster
29 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You