Answers for "asp.net core console app menu"

C#
0

asp.net core console app menu

private static bool MainMenu()
{
    Console.Clear();
    Console.WriteLine("Choose an option:");
    Console.WriteLine("1) Reverse String");
    Console.WriteLine("2) Remove Whitespace");
    Console.WriteLine("3) Exit");
    Console.Write("\r\nSelect an option: ");
 
    switch (Console.ReadLine())
    {
        case "1":
            ReverseString();
            return true;
        case "2":
            RemoveWhitespace();
            return true;
        case "3":
            return false;
        default:
            return true;
    }
}
Posted by: Guest on October-15-2021

C# Answers by Framework

Browse Popular Code Answers by Language