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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:50:22+00:00 2026-05-16T05:50:22+00:00

I’m trying to extract the names from this list: new String: blood cz TheDeAtH

  • 0

I’m trying to extract the names from this list:

new String:  blood cz            TheDeAtH              TBH DragonFire   Scotsman          King Kot            BobLeeSwagger          AffeMitWaffe    Jackobo          D L  fatality         Jack bobo           telex             apa           Tiger            zip     Guronzan          noobmaster           fear           piotrekjankiewi         RoCJackal 

These names will then have to be written into an array. I’ve done this so far:

NSString *newString = [[test componentsSeparatedByCharactersInSet:
       [[NSCharacterSet letterCharacterSet] invertedSet]] 
         componentsJoinedByString:@";"]; //yes there are spaces in the above list, previously they were replaced by ;

I then load it into an array:

 NSArray *chunks = [newString componentsSeparatedByString:@";"];

This works, but for the name “blood cz” for example, it takes blood and cz as a seperate thing in the array, but i need them to be together.

Does anyone have an idea of how I could achieve this? I’ve been breaking my head over this, because Im not able to seperate the strings. When taking the whitespaces out, its all together and I can seperate the strings, reason being that these strings are being taken from a gameserver website, where playernames change…

  • 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-16T05:50:23+00:00Added an answer on May 16, 2026 at 5:50 am

    This worked

    NSString         *mystring = @"blood cz            TheDeAtH              TBH DragonFire   Scotsman          King Kot            BobLeeSwagger          AffeMitWaffe    Jackobo          D L  fatality         Jack bobo           telex             apa           Tiger            zip     Guronzan          noobmaster           fear           piotrekjankiewi         RoCJackal";
    NSString *mystring2 = [mystring stringByReplacingOccurrencesOfString:@"  "  withString:@";"];
        NSCharacterSet   *separator   = [NSCharacterSet     characterSetWithCharactersInString:@";"];
    NSArray          *chunks      = [mystring2 componentsSeparatedByCharactersInSet:separator];
    
        for(NSString * myStr in chunks) {
            NSLog(myStr);
        }
    

    You still have to left trim the names (cutting of leading spaces) but I left some work for you.

    Also I want to add that this is best called a “hack”. Because it will NOT WORK anymore if a user enters a double space in a name.

    So I would take a step back and ask myself why I get such a lousy string to interpret and try to solve the problem at the source of the problem … This is my core answer: Check out whether you could get a better string.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
Does anyone know how can I replace this 2 symbol below from the string
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.