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

去除首尾空格:spa

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

去除首尾空格和換行:code

NSString *content = [textView.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
相關文章
相關標籤/搜索