C# Program to Convert Character case

CsharpServer Side ProgrammingProgramming

Let’s say your string is −

str = "AMIT";

To convert the above uppercase string in lowercase, use the ToLower() method −

Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());

Example

The following is the code in C# to convert character case.

Live Demo

using System;
using System.Collections.Generic;
using System.Text;
namespace Demo {
   class MyApplication {
      static void Main(string[] args) {
         string str;
         str = "AMIT";
         Console.WriteLine("UpperCase : {0}", str);
         // convert to lowercase
         Console.WriteLine("Converted to LowerCase : {0}", str.ToLower());
         Console.ReadLine();
      }
   }
}

Output

UpperCase : AMIT
Converted to LowerCase : amit
raja
Published on 24-Jul-2018 17:12:29
Advertisements