我需要在字符串末尾截断逗号,有点像这样:
NSString *string = @" this text has spaces before and after ";
NSString *trimmedString = [string stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
而不是 whitespaceCharacterSet 有类似 commaCharacterSet 的东西吗?