| Paste number 23283: | Elegance |
| Pasted by: | aedinius |
| When: | 2 years, 11 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+HYR |
| Channel: | #macosx |
| Paste contents: |
-returnUnique: aString {
int i;
id newString = [[NSMutableString alloc] init];
id charSet = [[NSMutableCharacterSet alloc] init];
for(i=0; i<[aString length]; i++) {
char c = [aString characterAtIndex:i];
if(![charSet characterIsMember: c]) {
[charSet addCharactersInString:[NSString stringWithFormat:@"%c", c]];
[newString appendFormat:@"%c", c];
}
}
return newString;
}This paste has no annotations.