Checking the given character is Lower or Upper case using C#.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under Visual Studio category on | Points: 40 | Views : 175
We have to write below code:-
We have IsLower and IsUpper method of Char Datatype.
string Words = "Test strING";
char[] chars = Words.ToCharArray();
for (int i = 0; i <= chars.Length-1; i++)
{
char c = chars;
if (Char.IsLetter(c))
{
if (Char.IsLower(c))
{
Response.Write(c + " is lowercase"+"<br>");
}
else if (Char.IsUpper(c))
{
Response.Write(c + " is uppercase" + "<br>");
}
}
}

Comments or Responses

Login to post response