• 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: Adding spaces to an NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding spaces to an NSString


  • Subject: Re: Adding spaces to an NSString
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Wed, 19 Mar 2008 09:41:47 +0100


On 19 Mar 2008, at 04:55, email@hidden wrote:

Yes, I have, Are you thinking insertString:atIndex:?

So at a basic level, can I get the string length, for loop through each
character and after each use insertString to add a space?

No. You may remember that if NSString talks of "characters", "length" or "index" it really means unsigned shorts in the UTF-16 encoding.
Which is NOT the same as there are (real) characters which are represented in Utf-16 as 2 shorts.


You might want to look at -[NSString rangeOfComposedCharacterSequenceAtIndex:].

Kind regards

Gerriet.

_______________________________________________

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


  • Prev by Date: Re: Carbon Menu in Cocoa app
  • Next by Date: Re: How to debug this Tiger release error?
  • Previous by thread: Re: Adding spaces to an NSString
  • Next by thread: DO problems
  • Index(es):
    • Date
    • Thread