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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:03:23+00:00 2026-06-14T03:03:23+00:00

I need help filtering NSStrings. Suppose I have a string called myString. NSString *myString

  • 0

I need help filtering NSStrings. Suppose I have a string called myString.

NSString *myString = @"HelloWorld";

How can I filter the word “Hello” out of it. Or how can I remove a specific amount of letters (Which it is beginning with) if I wanted to remove the first five letters.

Another example of what I’m facing:

NSString *myString = @"Hello hi World"; 

Similarly, I want to remove “Hello” and the space after that. Another time I might want to remove the two words “Hello hi” and the space after that so that only “World” is left.

Please can someone explain the basics of removing characters in NSStrings? I am totally new to the world of objective-c and reading the class-reference made me even more confused. I’m only 12 so don’t be harsh on me for not understanding the class-reference.

  • 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-14T03:03:24+00:00Added an answer on June 14, 2026 at 3:03 am

    For this case you need a NSMutableString:

    NSMutableString *mutableString = @"Hello World";
    [mutableString deleteCharactersInRange:NSMakeRange([mutableString length]-11, 6)];
    NSLog (@"%@", mutableString);
    

    Explanation for NSMakeRange: First you go to the end of the string and count back the length (11). Now you´re on the “H”-character. Now you delete the following six characters. “World” is now left over.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I almost have the data I want...but need help filtering it. (pic at bottom)
I need help with filtering rows from jqgrid. I have a grid with large
I need help identifying what these ANSI escape sequences represent. I'm currently filtering/evaluating the
Need help with a query that I wrote: I have three tables Company id
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
need help/guide for sql select query, I have 2 table stock and stock_history, in
need help regarding USSD Gateway. I have to develop an app, which will directly
need help in error in database pivot. i have table tamed table_score like below:
I need to sort some products base on user ratings. Suppose we have 3
I need to sort some products base on user ratings. Suppose we have 3

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.