some_id
some_id

Reputation: 29886

Removing the last character from an NSMutableString

How does one remove the last character from an NSMutableString?

Upvotes: 52

Views: 21004

Answers (1)

Matthias Bauch
Matthias Bauch

Reputation: 90117

You could use deleteCharactersInRange:

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

Upvotes: 141

Related Questions