去除string首尾空格:
NSString *NewString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
去除string首尾空格和换行:
NSString *NewString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
时间: 2024-12-25 05:52:07