Re: Adding spaces to an NSString
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