Is it possible to do negative loc in the NSMakeRange?
NSString *string = @"abc";
NSString *myString = [string substringWithRange:NSMakeRange(-1, 1)];
No.
location and length are unsigned integers :
typedef struct _NSRange {
NSUInteger location;
NSUInteger length;
} NSRange;
and also, NSMakeRange function is defined as follow :
NSRange NSMakeRange (
NSUInteger loc,
NSUInteger len
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With