int main() {
NSMutableString *s1 = [NSMutableString stringWithFormat:@"my age is 10"];
// 获取is的范围 NSRange range = [s1 rangeOfString:@"is"]; [s1 deleteCharactersInRange:range];
NSLog(@"s1=%@", s1);
return 0; }
如果s1变成 NSMutableString *s1 = [NSMutableString stringWithFormat:@"my age is 10,my name is Jake"]; 那能通过 rangeOfString 获得第二个is的范围吗?能同时获得两个is的范围吗?该怎么实现,谢谢
|