iOS-截取字符串中两个指定字符串中间的字符串

NSString *string = @"这是要截取的内容";

    NSRange startRange = [string rangeOfString:@"\">"];

    NSRange endRange = [string rangeOfString:@"

    NSRange range = NSMakeRange(startRange.location + startRange.length, endRange.location - startRange.location - startRange.length);

    NSString *result = [string substringWithRange:range];

    NSLog(@"%@",result);

你可能感兴趣的:(iOS-截取字符串中两个指定字符串中间的字符串)