去除string首尾空格:
NSString *NewString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
去除string首尾空格和换行:
NSString *NewString = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
时间: 2024-10-19 15:37:46