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

Stripping / Removing characters from String


  • Subject: Stripping / Removing characters from String
  • From: Alexander Hartner <email@hidden>
  • Date: Sun, 17 Dec 2006 17:28:30 +0000

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Stripping / Removing characters from String
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: NSScrollView custom thumbs
  • Next by Date: Re: Stripping / Removing characters from String
  • Previous by thread: Re: NSScrollView custom thumbs
  • Next by thread: Re: Stripping / Removing characters from String
  • Index(es):
    • Date
    • Thread