You could always write your own:
int count;
for (int i = 0; str[i]; i++) {
if (((str[i] & 0xDF) < 'A') || ((str[i] & 0xDF) > 'Z')) {
count++;
}
count++; That should do it. I believe it's about as fast as you can get, though there's probably more bit operations you can do. In case you hadn't realised, the
str[i] & 0xDF bit converts the character to uppercase - it can be replaced by
str[i] - 32 if you like.
EDIT: just realised this was the Java section :o - good luck with the conversion. Unfortunately, I don't know Java, so I can't help with that.