redo [6731] using the built-in stringByTrimmingCharactersInSet:

This commit is contained in:
Mitchell Livingston
2008-09-06 13:49:20 +00:00
parent fbea64b8ae
commit b121a59172
4 changed files with 2 additions and 17 deletions
-13
View File
@@ -38,19 +38,6 @@
return [self stringByAppendingString: [NSString ellipsis]];
}
- (NSString *) stringByTrimmingWhitespace
{
NSString * newString = self;
while ([newString length] > 0 && [[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:
[newString characterAtIndex: [newString length] - 1]])
newString = [newString substringToIndex: [newString length] - 1];
while ([newString length] > 0 && [[NSCharacterSet whitespaceAndNewlineCharacterSet] characterIsMember:
[newString characterAtIndex: 0]])
newString = [newString substringFromIndex: 1];
return newString;
}
+ (NSString *) stringForFileSize: (uint64_t) size
{
if (size < 1024)