Reputation: 213
Iam adding some text content to nsmutablestring in the form of dictionary format and again that every dictionary is split by ","(commos). But when getting this total string its displays (,) to string of ending. So how to remove that ","(commos) in that mutable string.
Please guide me if any one knows
Thanking in advance
Upvotes: 3
Views: 5429
Reputation: 23510
Doing that way, you keep the mutable property of your string:
[mutableString setString:[mutableString substringToIndex:[mutableString length]-1]];
Upvotes: 7
Reputation: 98
To remove the last character of a string you can write:
string = [string substringToIndex:[string length] - 1];
Upvotes: 3
Reputation: 900
This is how you need to remove character from NsmutableString....
NSRange range = NSMakeRange([concatedstring length]-1,1);
[concatedstring replaceCharactersInRange:range withString:@""];
Upvotes: 11