Stripping / Removing characters from String
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