Reputation: 14113
I have a NSMutableString
. I need to check whether the last character is @":" or last two characters are @": "
How to do that?
Upvotes: 0
Views: 386
Reputation: 6490
Identifies last char:
NSString *lastChar = [yourstr substringFromIndex: [yourstr length] - 1];
Identifies last two chars:
NSString *lastTwoChar = [yourstr substringFromIndex: [yourstr length] - 2];
Upvotes: 1