The solutions given here actually do not take into account multi-byte Unicode characters ("composed characters"), and could result in invalid Unicode strings.
In fact, the iOS header file which contains the declaration of `substringToIndex` contains the following comment:
> Hint: Use with rangeOfComposedCharacterSequencesForRange: to avoid breaking up composed characters
See [how to use `rangeOfComposedCharacterSequenceAtIndex:`][1] to delete the last character correctly.
[1]:
[To see links please register here]