1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
public void countUpperLower (string a, out int upper, out int lower) {
lower = 0; upper = 0;
unsafe {
fixed (char* cTmp = a) {
char* c = cTmp;
char* end = c + a.Length;
while (c < end) {
if (*c > 64 && *c < 91 )
upper++;
if (*c > 96 && *c < 123)
lower++;
c++;
}
}
}
}
|