将字符串转化为可变字符串,再根据指定字符查找该字符,再在该字符前面插入换行符
NSMutableString * name = [NSMutableString stringWithFormat:@"%@",model.name];
NSRange range = [name rangeOfString:@"("];
if (range.location != NSNotFound) {
[name insertString:@"\n" atIndex:range.location];
}
网友评论