Alex Rivera | Logout

Remove characters in NSCharacterSet from NSString

Asked 2010-08-13T12:07:15.873
18

I have an NSCharacterSet which contains all the characters I want to remove from my NSString.

How can I do that?

Edit
Report

1 Answer

3

You can use an NSScanner to scan through the string, scanning a chunk of characters-not-in-the-set, appending it to your result string, scanning the characters-in-the-set into a variable you otherwise ignore, and repeating until the scanner reaches the end.

answered 2010-08-13T12:17:22.470

Your Answer