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

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


References: 
 >How to convert an NSString to (From: Ronald Hofmann <email@hidden>)
 >Re: How to convert an NSString to (From: Igor Elland <email@hidden>)
 >Re: How to convert an NSString to (From: Tamas Nagy <email@hidden>)
 >Re: How to convert an NSString to (From: Igor Elland <email@hidden>)

  • Prev by Date: Re: How to convert an NSString to
  • Next by Date: Re: Mixing Obj-C and C "methods"
  • Previous by thread: Re: How to convert an NSString to
  • Next by thread: IOS floating point performance
  • Index(es):
    • Date
    • Thread