Jump to content

Regular expressions: Difference between revisions

Line 725:
}</lang>
Unfortunately this method cannot find the location of the match or do substitution.
 
===NSRegularExpressionSearch===
{{works with|iOS|3.2+}}
Test
<lang objc>NSString *str = @"I am a string";
if ([str rangeOfString:@"string$" options:NSRegularExpressionSearch].location != NSNotFound) {
NSLog(@"Ends with 'string'");
}</lang>
 
===NSRegularExpression===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.