Re: (newbie question) Putting special characters in NSStrings
Re: (newbie question) Putting special characters in NSStrings
- Subject: Re: (newbie question) Putting special characters in NSStrings
- From: Simon Strandgaard <email@hidden>
- Date: Mon, 21 Mar 2005 19:33:22 +0100
On Fri, 18 Mar 2005 11:33:36 -0800, Ben Borofka <email@hidden> wrote:
> I have a bunch of special characters I need to put in NSStrings and
> NSArrays of NSStrings:
>
> " ! @ # $ % ^ *
>
> I've been just using, for example, [[NSString alloc ]
> initWithString:@"!"] to create the string but I don't think they are
> working for all those special characters. What's the best way to put
> those into an NSString? I can't find any simple, easy examples.
I am also new to cocoa myself.. but this question I can answer :-)
static unichar UC_CJK = 0x4E21;
NSString* str0 = [
[NSString alloc] initWithFormat:@"<%@>",
[NSString stringWithCharacters: &UC_CJK length: 1]
];
Hope this helps.
--
Simon Strandgaard
_______________________________________________
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