11 February 2014

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

          string Words = "Adi Dotnet";
            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>");
                    }
                }
            }

No comments:

Post a Comment