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

  • SEARCH
  • Home
  • 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 9172623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:23:36+00:00 2026-06-17T16:23:36+00:00

I have a NSString with some text that i want to remove,this is the

  • 0

I have a NSString with some text that i want to remove,this is the text that i want to remove from the NSString:

Textid="more-98989">

the number can change to another number.

Any way to do it ? Did i need Regex for this?

  • 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-17T16:23:37+00:00Added an answer on June 17, 2026 at 4:23 pm

    You can definitely do it wit a regular expression, but you can also do without it just as easily. Locate the initial part of the string that you would like to remove, then search for the closing "> starting at the location of the Textid=". This will give you the range of characters that needs to be removed.

    NSString *myString = "Blah blah Textid="more-98989"> More stuff";
    NSString *res = nil;
    NSRange start = [myString rangeOfString:@"Textid=\""];
    if (start.location != NSNotFound) {
        NSRange end = [myString rangeOfString:@"\">" withOptions:NSLiteralSearch range:NSMakeRange(start.Location+1, myString.length-start.location-1)];
        if (end.location != NSNotFound) {
            res = [myString stringByReplacingCharactersInRange:NSMakeRange(start.location, end.location-start.location+2) withString:@""];
        }
    }
    if (!res) {
        // Starting or ending tags were not found
        res = myString;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have NSString like My name is. I want to remove text after coming
I want to post some text with image on Facebook wall. I have this
I have some code that is supposed to return an NSString. Instead it is
I have some NSString varibales that incude items like Ð and Õ and if
I have an iPhone app that will let users email some pre-determined text as
I have looked everywhere and can't find a solution that works for this. I
I have some reviews with the date that has been created, so I want
I have some text that needs to be displayed in my app. The text
I have an NSString like @Hello World and want to convert that into an
I have an NSString in Objective-C that I want to find the size of

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.