A somewhat inefficient way of doing this:
NSString *s = @"foo/bar:baz.foo";
NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@"/:."];
s = [[s componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""];
NSLog(@"%@", s); // => foobarbazfoo
Look at NSScanner
and -[NSString rangeOfCharacterFromSet: ...]
if you want to do this a bit more efficiently.