Re: NSString to ascii code
Re: NSString to ascii code
- Subject: Re: NSString to ascii code
- From: Rustam Muginov <email@hidden>
- Date: Mon, 17 Jan 2005 11:19:48 +0300
On 1/17/05 11:13 AM, "Peter Karlsson" <email@hidden> wrote:
> Dear list!
>
> I have a NSString like this:
>
> NSString *myString = @"A";
>
> I want to get the ascii code 65 from myString, how do I do that in Cocoa?
>
const char *ptr = [myString cString];
Be warned this could raise NSCharacterConversionException exception if your
string contains any characters which could not be handled as pure 7-bit
ASCII
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden