• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: (newbie question) Putting special characters in NSStrings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >(newbie question) Putting special characters in NSStrings (From: Ben Borofka <email@hidden>)

  • Prev by Date: Re: Tools for creating icons
  • Next by Date: Re: command line arguments
  • Previous by thread: Re: (newbie question) Putting special characters in NSStrings
  • Next by thread: Re: (newbie question) Putting special characters in NSStrings
  • Index(es):
    • Date
    • Thread