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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:21:44+00:00 2026-06-04T18:21:44+00:00

i am getting text like :- 1. e4 e5 2. Nf3 Nc6 3. Bb5

  • 0

i am getting text like :-
1. e4 e5 2. Nf3 Nc6 3. Bb5 {This opening is called the Ruy Lopez.} 3... a6
4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8 10. d4 Nbd7
11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5

I need to remove {the comment inside the } but before that i need to copy it along with the index number of the move like with 3 or with Bb5.

inorder to remove the string i am using

- (NSString *)stringFilter:(NSString *)targetString {

    NSScanner *theScanner;
    NSString *text = nil;

    theScanner = [NSScanner scannerWithString: targetString];

    while ([theScanner isAtEnd] == NO) {

        [theScanner scanUpToString:@"{" intoString:NULL] ; 

        [theScanner scanUpToString:@"}" intoString:&text] ;

        targetString = [targetString stringByReplacingOccurrencesOfString:
                      [NSString stringWithFormat:@"%@}", text]
                                                           withString:@""];

    } 

    return targetString;

}

I am looking for how can i copy that string and store it in dictionary or array thanks.

  • 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-04T18:21:45+00:00Added an answer on June 4, 2026 at 6:21 pm

    I use the following category method to get the contents between ‘(‘ & ‘)’. You can adapt it easily…

    EDIT: Full category for completeness

    //  NSString+Parenthesis.h
    #import <Foundation/Foundation.h>
    
    @interface NSString (Parenthesis)
    
    -(NSString*)contentsInParenthesis;
    
    @end
    
    //  NSString+Parenthesis.m
    #import "NSString+Parenthesis.h"
    
    @implementation NSString (Parenthesis)
    
    -(NSString*)contentsInParenthesis {
        NSString *subString = nil;
        NSRange range1 = [self rangeOfString:@"("];
        NSRange range2 = [self rangeOfString:@")"];
    
        if ((range1.length == 1) && (range2.length == 1) && (range2.location > range1.location)) {
            NSRange range3;
            range3.location = range1.location+1;
            range3.length = (range2.location - range1.location)-1;
    
            subString = [self substringWithRange:range3];
        }
    
        return subString;
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After getting data from a database as UTF8 my text looks like this (example):
I am getting this error alt text http://img239.imageshack.us/img239/6936/jserror.png when the map loads. The error
I am getting this error : ERRNO: 2 TEXT: Division by zero LOCATION: C:\xampp\htdocs\final\classes\customer.php,
I have some text like $text=--e89a8f234aade3345704b8477b83 Content-Type: text/plain; charset=ISO-8859-1 this is a text. this
i have created a textview with underline text like this <TextView android:id=@+id/label android:layout_width=wrap_content android:layout_height=wrap_content
Any idea what's the code for getting text with every letter in bubble like
I'm getting text from an API and it's something like following: text = 'replied
I have text similar like this: <html><p>this is <b>the</b> text</p> and <p>this is another
I'm getting warnings about CSS3.0 properties like text-overflow. Is there a way to validate
I have some text like below saved in a text file &lt;b&gt;This is my

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.