I knew a instance method of NSString.
- (NSRange)rangeOfString:(NSString *)aString
My source string looks like this: "abcdEFGhi"
When I use [srcStr.rangeOfString:@"efg"];
, there is no substring was found.
How can I solve this problem?
There is one more version of rangeOfString
method you could use that.
- (NSRange)rangeOfString:(NSString *)aString options:(NSStringCompareOptions)mask
So use as below
[srcStr rangeOfString:@"efg" options:NSCaseInsensitiveSearch];
I think you're looking for:
[srcStr rangeOfString:@"efg" options:NSCaseInsensitiveSearch];
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