How to remove the first n characters from an NSString

There’s a convenient method for that by the name of substringFromIndex. This example removes the first character:

substringFromString takes only one parameter which specifies where to start the new string. The first character is 0 based, like in arrays. The parameter can’t be longer than the original string’s length for obvious reasons.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.