Objective C - Using deleteCharactersInRange for NSMutableStrings

How can I use deleteCharactersInRange to delete the first character of NSMutableString?

+3
source share
1 answer

It's not that hard ...

NSMutableString *a = [NSMutableString stringWithString:@"aString"];
NSRange range;
range.location = 0;
range.length = 1;
[a deleteCharactersInRange:range];

You can shorten the range creation as follows:

NSRange range = {0,1}; // edit: of course 0,1 instead of 1,0, thanks Omar
+18
source

Source: https://habr.com/ru/post/1711989/


All Articles