Case Changing in C# with StringToUpper and StringToLower Methods


In c# programming language ,we use many type of operation on string.Changing case of string is one of them.In case changing,we change case string,lower to upper case and upper to lower case.today i will show you a program that impliment two method StringToUpper and StringToLower in C# program for case changing

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#:

using System;
using System.Collections.Genric;
using System.Text;

namespace Csharpcase

{

class Program

{

static void Main(string[]args)

{

String Givenstring="This IS STring in upper case";

Console.WriteLine(Givenstring.ToUpper());

String Givenstring1='thIS IS strING IN LOWER case";

Console.WriteLine(Givenstring1.ToLower());
}
}
}

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...


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: