Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
5
Task/String-matching/Objective-C/string-matching.m
Normal file
5
Task/String-matching/Objective-C/string-matching.m
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[@"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
|
||||
Loading…
Add table
Add a link
Reference in a new issue