NSCharacterSet
NSCharacterSet
实例应用:
一、过滤字符串开始位置和结束位置的空格
1 NSString *testString = @" my name is wang tianqiao ";
2
3 NSString *cString = [testString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
3 NSString *cString = [testString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
4 NSLog(@"cString is %@",cString);