Re: How to convert an NSString to
Re: How to convert an NSString to
- Subject: Re: How to convert an NSString to
- From: Tom Davie <email@hidden>
- Date: Wed, 07 Aug 2013 09:36:31 +0200
On 7 Aug 2013, at 09:24, Igor Elland <email@hidden> wrote:
>>
>> Or if you just want to convert the spaces: string = [@"Ich möchte am Wettbewerb teilnehmen" stringByReplacingOccurrencesOfString:@" " withString:@" ”];
>
> Please avoid using that, if you really need **only** white space to be replaced, you want to use [@"Ich möchte am Wettbewerb teilnehmen" stringByReplacingCharactersInSet:[NSCharacterSet whitespaceCharacterSet] withString:@" ”] instead, as there are different UTF-8 characters for different kinds of whitespace.
This is incorrect. is specifically for representing the 0x20th Unicode character – that is “space”. It is not for representing other whitespace characters like tab ( ) etc.
Tom Davie
_______________________________________________
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