• 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: Stripping / Removing characters from String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stripping / Removing characters from String


  • Subject: Re: Stripping / Removing characters from String
  • From: "I. Savant" <email@hidden>
  • Date: Sun, 17 Dec 2006 13:11:52 -0500


A quick archive search find this: http://www.cocoabuilder.com/archive/ message/cocoa/2005/3/31/131870


--
I.S.


On Dec 17, 2006, at 12:28 PM, Alexander Hartner wrote:

What is the best way to remove "invalid" characters from a NSString. I tried the following :


NSCharacterSet * invalidCharacters = [[NSCharacterSet alphanumericCharacterSet]invertedSet];
NSString * firstName = [input stringByTrimmingCharactersInSet:invalidCharacters];


But this only removes characters on the start and end of the string. I searched quite a bit for a method to
remove characters from a NSString. Of course I could parse it myself, but I am hopeful that there is a
better way. Surely this has been addressed.




Alexander Hartner
email@hidden

Thus spake the master programmer:
``Let the programmers be many and the managers few - then all will be productive.''
- The Tao of Programming





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40gmail.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Stripping / Removing characters from String (From: Alexander Hartner <email@hidden>)

  • Prev by Date: Stripping / Removing characters from String
  • Next by Date: Re: View Question
  • Previous by thread: Stripping / Removing characters from String
  • Next by thread: NSMatrix, NSImageCell and selection indicator
  • Index(es):
    • Date
    • Thread