Changing Character Casing in C#
In C# programming ,we can change string case in Upper case to lower case and lower case to upper case.
Method that compare string and characters in string are case sensitive,you can need convert casing of string characters that are entered by user before comparing them to constant value. we can change string cases with these two methods:
1.StringToUpper: It convert all character in a string to uppercase.
1.StringToLower: It convert all character in a string to lowercase.
we will use these two methods in our program for show how to change character casing in C#:
static void Main(stringargs)
String Givenstring="This IS STring in upper case";
String Givenstring1='thIS IS strING IN LOWER case";
This program show out put like as Given bellow:
THIS IS STRING IN UPPER CASE
this is string in lower case
Press any key to continue...