ios 去除字符串首尾空格、换行

去除首尾空格:

NSString * content = [textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

去除首尾空格和换行:

NSString *content = [textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

你可能感兴趣的:(ios 去除字符串首尾空格、换行)