I have two NSStrings named country and searchtext. I need to check whether the country contains the searchtext.
Eg: country = Iceland and searchtext = c, here the word iceland contains the character ‘c’.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this:
You also have the position (location) and length of your match (uninteresting in this case but might be interesting in others) in your range object. Note that
searchtextmust not benil. If you are only interested in matching (and not the location) you can even condense this into