I must verify the beginning of a string: my example string is
NSString *string1 = @"Hello World";
then I must do an if, example:
if (string1 startwith "Hello")
How can I do this in objective c?
if ([string1 hasPrefix:@"Hello"])
Read the documentation for the NSString class. You'll find all kinds of surprises.
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