//去除字符串中用括号括住的位置 -(NSString *)handleStringWithString:(NSString *)str{ NSMutableString * muStr = [NSMutableString stringWithString:str]; while (1) { NSRange range = [muStr rangeOfString:@"("]; NSRange range1 = [muStr rangeOfString:@")"]; if (range.location != NSNotFound) { NSInteger loc = range.location; NSInteger len = range1.location - range.location; [muStr deleteCharactersInRange:NSMakeRange(loc, len + 1)]; }else{ break; } } return muStr; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-11-06 03:48:16