• 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: Converting ASCII Code to a Character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting ASCII Code to a Character


  • Subject: Re: Converting ASCII Code to a Character
  • From: Nick Zitzmann <email@hidden>
  • Date: Thu, 31 Jul 2003 00:25:25 -0700

On Wednesday, July 30, 2003, at 11:03 PM, Andrew Kazmierski wrote:

I have a NSString with an ASCII code like @"65" which is the index of "A" in the ASCII character table. How can I convert any ASCII code, such as that one, to a character contained in a NSString?

Using the regular Foundation library:

unichar asciiChar = 65; // the character A; can also be written like 'A' or 0x0041
NSString *stringWithAsciiChar = [NSString stringWithCharacters:&asciiChar length:1];

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://seiryu.home.comcast.net/

"I have always wished that my computer would be as easy to use as my telephone. My wish has come true. I no longer know how to use my telephone." - Bjarne Stroustrup
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Converting ASCII Code to a Character (From: Andrew Kazmierski <email@hidden>)

  • Prev by Date: Re: Converting ASCII Code to a Character
  • Next by Date: NSDocument/NSFileWrapper troubles
  • Previous by thread: Re: Converting ASCII Code to a Character
  • Next by thread: Re: Memory Management
  • Index(es):
    • Date
    • Thread