How do I verify in C# that the password contains at least X uppercase letters and at least Y numbers, and the entire string is longer than Z?
Thanks.
To count uppercase letters and digits:
string s = "some-password"; int upcaseCount= 0; int numbersCount= 0; for (int i = 0; i < s.Length; i++) { if (char.IsUpper(s[i])) upcaseCount++; if (char.IsDigit(s[i])) numbersCount++; }
and check s.Length for the length
s.Length
good luck!