C Sharp/C# – String Uppercase/Lowercase Conversion

By | April 28, 2011

Hi,

It will be very useful to know how you can convert a given string into uppercase or lowercase using program.
We are going to show you , how to convert a given string into uppercase or lowercase using C Sharp/C#. See the example given below.

using System;

class MainClass {
  public static void Main() {

    string sampleString = "CoDeRzHeAvEn";

    string strLwrCase = sampleString .ToLower();
    string strUprCase =  sampleString .ToUpper();

    Console.WriteLine("Lowercase of sampleString :n " +  strLwrCase );
    Console.WriteLine("Uppercase of sampleString :n " +  strUprCase );

  }
}

Output :
Lowercase of sampleString :
coderzheaven
Uppercase of sampleString :
CODERZHEAVEN

🙂

One thought on “C Sharp/C# – String Uppercase/Lowercase Conversion

Leave a Reply

Your email address will not be published. Required fields are marked *