Jump to content

String matching: Difference between revisions

→‎{{header|Objective-C}}: we only need one objective c section
(→‎[[Character matching#ALGOL 68]]: put back C, ObjC & Java specimen)
(→‎{{header|Objective-C}}: we only need one objective c section)
Line 39:
TFFT -1 +1 +3
</pre>
=={{header|Objective-C}}==
<lang objc>
[@"abcd" hasPrefix:@"ab"] //returns true
[@"abcd" hasSuffix:@"zn"] //returns false
int loc = [@"abab" rangeOfString:@"bb"].location //returns -1
loc = [@"abab" rangeOfString:@"ab"].location //returns 0
loc = [@"abab" rangeOfString:@"ab" options:0 range:NSMakeRange(loc+1, [@"abab" length]-(loc+1))].location //returns 2
</lang>
 
=={{header|C++}}==
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.