这里需要用到正则表达式
NSString *superString = @"abcdeabc";
NSString *subString = @"ab";
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:subString options:0 error:nil];
NSArray <NSTextCheckingResult *>*matches = [regex matchesInString:superString options:0 range:NSMakeRange(0, superString.length)];
[matches enumerateObjectsUsingBlock:^(NSTextCheckingResult * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSRange range = obj.range;
}];