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