mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
redo [6731] using the built-in stringByTrimmingCharactersInSet:
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user