I am trying to find a better way to count the number of uppercase characters that are in NSString. I know how to find out if a certain character is uppercase using this code:
NSString *s = @"This is a string"; BOOL isUppercase = [[NSCharacterSet uppercaseLetterCharacterSet] characterIsMember:[s characterAtIndex:0]];
What would be the best way to count the number of capital letters in an NSString? Thanks.
source share