Paste number 23283: Elegance

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:
Raw Source | XML | Display As
-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.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.