Saturday, February 11, 2017

Console Application in Visual Studio to convert a string to uppercase and lowercase

Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string str;
            Console.WriteLine("Please enter a string...");
            str = Console.ReadLine();
            Console.WriteLine("String converted to Uppercase");
            Console.WriteLine(str.ToUpper());
            Console.WriteLine("String converted to Lowercase");
            Console.WriteLine(str.ToLower());
            Console.ReadKey();
        }
    }
}

Output:



No comments:

Post a Comment