Removing the last character from an NSMutableString

Objective C

Objective C Problem Overview


How does one remove the last character from an NSMutableString?

Objective C Solutions


Solution 1 - Objective C

You could use deleteCharactersInRange:

NSMutableString *str = [NSMutableString stringWithString:@"FooBarx"];
[str deleteCharactersInRange:NSMakeRange([str length]-1, 1)];

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionsome_idView Question on Stackoverflow
Solution 1 - Objective CMatthias BauchView Answer on Stackoverflow