Sponsored Ad

Saturday, March 12, 2011

How to Print a String in Uppercase and Lowercase using C#

Here is simple demo program to print a given string in uppercase and lowercase string using string inbuilt function.

How to Print a String in Uppercase and Lowercase using C#

C# Program :

using System;

namespace MyApp
{
    class Case_class
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter a string:");
            string str = Console.ReadLine();

            Console.WriteLine(" Lowercase string: "+ str.ToLower());
            Console.WriteLine(" Uppercase string: " + str.ToUpper());
            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment

Sponsored Ad

Development Updates