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 6927007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:59:32+00:00 2026-05-27T10:59:32+00:00

So pretty much I want to check if my NSString from my NSArray is

  • 0

So pretty much I want to check if my NSString from my NSArray is a substring of my string named imageName.

So lets say this:

  1. My Image name is: picture5of-batman.png
  2. My Array contains strings and one of them is: Batman

So pretty much I want to eliminate the: picture5of- part of the image name and replace it with the NSString from the NSArray.

This is how I try to do it but it never makes it to the if statement. And no my Array is not nil either. Here is the code:

for (NSString *string in superheroArray) {
    if ([string rangeOfString:imageName].location != NSNotFound) {
        //Ok so some string in superheroArray is equal to the file name of the image
        imageName = [imageName stringByReplacingOccurrencesOfString:@"" withString:string 
                                                      options:NSCaseInsensitiveSearch range:NSMakeRange(0, string.length)];

    }
}

Edit1: This still does not work

for (NSString *string in superheroArray) {
        if ([imageName rangeOfString:string options:NSCaseInsensitiveSearch].location != NSNotFound) {
            //Ok so some string in superheroArray is equal to the file name of the image
            imageName = string;
            //HOW ABOUT THAT FOR EFFICIENCY :P
        }

}

  • 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-05-27T10:59:33+00:00Added an answer on May 27, 2026 at 10:59 am
    [imageName rangeOfString:string options: NSCaseInsensitiveSearch]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is pretty much what I want to do.... So, the user is browsing
I'm displaying a series of images in a UIScrollView. I pretty much want to
I want to make many inserts in a single SQL statement, pretty much like
Pretty much the same as this question. But I can't seem to get this
Pretty much every other editor that isn't a vi descendant (vim, cream, vi-emu) seems
Pretty much what the title says really. We have some code that is .NET
pretty much what the title says. I am using an Ajax Drop Down as
Pretty much as the question asks. Answers preferably in pseudo code and referenced. The
Pretty much what the question says. What's the difference between the two classes of
Pretty much the opposite of server-side push, also known as Comet . I'm wondering

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.