NSString 从字符串开头截取到指定字符的位置 Sep 7th, 2015 11:50 am NSRange range = [srcStr rangeOfString:@","]; NSString *str = [srcStr substringToIndex:range.location]; NSLog(@"%@",str);