Re: How to check the capital letter?
Re: How to check the capital letter?
- Subject: Re: How to check the capital letter?
- From: Ron Fleckner <email@hidden>
- Date: Mon, 11 Aug 2008 23:43:25 +1000
- Resent-date: Mon, 11 Aug 2008 23:53:15 +1000
- Resent-from: Ron Fleckner <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Cocoa-dev List <email@hidden>
On 11/08/2008, at 11:35 PM, Jean-Daniel Dupas wrote:
Le 11 août 08 à 15:29, Ron Fleckner a écrit :
Hi, I don't remember if there is a Cocoa solution, but of course
you can use plain C:
NSString *str = @"Aa";
char first = [str characterAtIndex:0];
char second = [str characterAtIndex:1];
NSLog(@"%c is %@.", first, isupper(first) ? @"uppercase" :
@"lowercase");
NSLog(@"%c is %@.", second, isupper(second) ? @"uppercase" :
@"lowercase");
Result:
A is uppercase.
a is lowercase.
Wrong. characterAtIndex: return an unichar not a char, which is
AFAK an UTF16 character.
Yes, I saw that. But it still works. No compiler warning either.
Would it be a problem?
Ron_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden