C# Program to Convert Character case


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

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 19-Jun-2020

324 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements