Home > Code > C# > Find the given character is lower or upper case using c#.net?

Find the given character is lower or upper case using c#.net?

by Narain Siddharth   on Dec 14, 2011   Category: C#   |  Views: 3987    |  Points: 25   |  Silver 


The below simple C# code snippet shows how to find out the lower or upper case in the given string.


string Words = "Test strING";
char[] chars = Words.ToCharArray();
for (int i = 0; i < chars.Length; 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>");
}
}
}





Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts