Search code examples
iphonensmutablestring

NSMutableString check last and second last character


I have a NSMutableString. I need to check whether the last character is @":" or last two characters are @": "

How to do that?


Solution

  • Use the hasSuffix: method of NSString.