I am trying to count the characters in a text field. I found how to count all the characters.
string st = TextBox1.Text;
this.TextBox2.Text = Regex.Matches(st, ".|").Count.ToString();
But I need to create 2 more separate counts, Any Caps, numbers, – or # up to (not including) @
eg. LA-FG4-DETF-DJJJTHD-S@T-JHF-F1-F2 the count would be 21
and the other one I need to count from the @ (including) , Any Caps, numbers, – or # to the end of the text field.
eg. LA-FG4-DETF-DJJJTHD-S@T-JHF-F1-F2 the count would be 12
Any help would be appreciated.
1 Answer