Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:27:09+00:00 2026-06-04T09:27:09+00:00

I have to search a word in an array using UISearchBar. for example i

  • 0

I have to search a word in an array using UISearchBar. for example i have “Chicken Salad” string in an array at index 2. now if want to search it using last word “Salad” then what should i do?
for the time i am using this code and it is working good but if you search from first word.

(appDelegate.isAirlineSelection == YES) {
            for (int i = 0; i < [menuArray count]; i++) {
                if ([[[[menuArray objectAtIndex:i] itemName] uppercaseString] hasPrefix:search]||[[[[menuArray objectAtIndex:i] itemName] uppercaseString] hasSuffix:search]) {
                    [tableMenuArray addObject:[menuArray objectAtIndex:i]];
                    NSLog(@"Found");
                }
            }

Kindly help me

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:27:11+00:00Added an answer on June 4, 2026 at 9:27 am

    try this way, It’ll search even between the words:

    for(NSString *name in menuArray)        
    {
        if ([name rangeOfString:search options:NSLiteralSearch|NSCaseInsensitiveSearch].location != NSNotFound)
            [tableMenuArray addObject:name];
                NSLog(@"Found");
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a simple search function. I have a string array which
In excel I have to search for specific word in a cell and replace
I have a binary search function that will search for a word in an
I have a search method that takes in a user-entered string, splits it at
Below is what I have in my Array... myArray = {about,name,dsafasdf,fix}; I want to
I would like to search through my NSArray for a certain string. Example: NSArray
I have a simple requirement (perhaps hypothetical): I want to store english word dictionary
This is part of an assignment to complete a word search. I have to
I'm using Python in conjunction with MongoDB. I have an array of words, and
I have an array of dictionary words and a random string like twowords What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.