Convert string to upper case and lower case

To convert a string to upper case we use ToUpper method. Return type of this method is string.

To convert a string into lower case we use ToLowermethod. Return type of this method is string.

string str = "i like rain";
str = str.ToUpper();
Console.WriteLine(str);

str = str.ToLower();
Console.WriteLine(str);

Output

I LIKE RAIN
I like rain

Comments

Popular posts from this blog

Check if ViewBag is null or doesn't exist

Using Progress Bar In C#

Jquery serer side datatables in asp.net