Sha256: 7f2f110e4b98c7d82282637904e020622afb0aac6a70dc30eb33c5ba3c951679
Contents?: true
Size: 724 Bytes
Versions: 4
Compression:
Stored size: 724 Bytes
Contents
// // NSStringWhiteSpace.m // YueBao // // Created by eiffel on 10-4-8. // Copyright 2010 www.likenote.com. All rights reserved. // #import "NSStringWhiteSpace.h" @implementation NSString (Whitespace) - (NSString *)stringByCompressingWhitespaceTo:(NSString *)seperator { NSArray *comps = [self componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; NSMutableArray *nonemptyComps = [[[NSMutableArray alloc] init] autorelease]; // only copy non-empty entries for (NSString *oneComp in comps) { if (![oneComp isEqualToString:@""]) { [nonemptyComps addObject:oneComp]; } } return [nonemptyComps componentsJoinedByString:seperator]; // already marked as autoreleased } @end
Version data entries
4 entries across 4 versions & 1 rubygems