trim whitespace from server info responses

This commit is contained in:
Diego Waxemberg
2015-04-05 20:30:13 -07:00
parent fd9ee45dac
commit f43c74d59b
3 changed files with 18 additions and 5 deletions
+6
View File
@@ -24,3 +24,9 @@ FOUNDATION_EXPORT NSString *const deviceName;
+ (int) resolveHost:(NSString*)host;
@end
@interface NSString (NSStringWithTrim)
- (NSString*) trim;
@end
+7
View File
@@ -73,5 +73,12 @@ NSString *const deviceName = @"roth";
}
}
@end
@implementation NSString (NSStringWithTrim)
- (NSString *)trim {
return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}
@end