I have this NSString:
NSString *test = @"three is a number";
I want to check if this NSString begin with "three"
It's done by
if([test hasPrefix:@"three"]){
...
}
General answer: whenever you want to check if NSString (or any Apple-provided class,) look up the official documentation! In this case, see here. You see, there's not only StackOverflow on the internet, there's the official documentation!