Hello Everyone, would like to ask if how to count the lowercase letter detected in textbox? please refer me to the right link or please give me example?
Thank you & Godbless
How to count lowercase letter in Textbox
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Nov 13, 2013, 7:03 PM EST
You can count using RegEx.
using System.IO;
using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
string strRegex = @"(?<=[a-z])";
RegexOptions myRegexOptions = RegexOptions.Multiline;
Regex myRegex = new Regex(strRegex, myRegexOptions);
string strTargetString = @"ADGFesD";
Console.WriteLine("The string has " + myRegex.Matches(strTargetString).Count + " lowercase letters");
}
}
Rajesh Kumar JhaRank #9,215 · 209 reputationPosted Nov 13, 2013, 7:00 PM EST
Try Doing the following....
foreach (char ch in TextBox1.Text.ToCharArray())
{
if(Char.IsLower(ch))
count++;
}
mary jean ligasRank #3,676 · 400 reputationPosted Nov 13, 2013, 7:03 PM EST