I need to substring to the 2nd comma in an NSString.
Input:
NSString *input = @"title, price, Camry, $19798, active";
Desired Output:
NSString *output = @"title, price";
Thanks!
UPDATE:
I have the following but the problem is it needs to skip the last comma:
NSString *output = [input rangeOfString:@"," options:NSBackwardsSearch];
this code should do what you need: