删除字符串中某字符
if ([num intValue] == 0) {
num = @1;
if ([self.mString containsString:sort.adTypeName]) {
} else {
[self.mString appendFormat:@"%@,", sort.adTypeName];
}
} else {
num = @0;
//获取到该字符串的位置.根据位置将字符串删除
NSRange range = [self.mString rangeOfString:sort.adTypeName];
[self.mString deleteCharactersInRange:NSMakeRange(range.location, range.length + 1)];
num = @1;
if ([self.mString containsString:sort.adTypeName]) {
} else {
[self.mString appendFormat:@"%@,", sort.adTypeName];
}
} else {
num = @0;
//获取到该字符串的位置.根据位置将字符串删除
NSRange range = [self.mString rangeOfString:sort.adTypeName];
[self.mString deleteCharactersInRange:NSMakeRange(range.location, range.length + 1)];
}
posted on 2015-12-04 17:27 taiyang2014 阅读(194) 评论(0) 编辑 收藏 举报