Reputation: 947
I would like to search for a specific last character in a NSString and couldn't figure out a way. In C# for example, I can do lastindexof to get the index of the char I'm searching for and then use substring to get what I want. Is there a way in Obj C to achieve this?
Upvotes: 0
Views: 109
Reputation: 32414
NSString *s = @"aabbcc";
[s rangeOfString:@"b" options:NSBackwardsSearch]; // {3, 1}
Upvotes: 1