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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:29:50+00:00 2026-06-18T10:29:50+00:00

I have many NSString which look like this: @this is the content. The content

  • 0

I have many NSString which look like this:

@"this is the content. The content of this string may vary, as well as the length, and my include any characters, with numbers Y = 295.000000 X = 207.500000"

The part Y = 295.000000 X = 207.500000 remains always the same, apart from the X and Y numbers which may change.

I need in some way to get those numbers and do something like this:

coordsFinal.x = 295.000000;
coordsFinal.y = 207.500000;

which would have the format of:

coordsFinal.x = [NSString stringWithFormat: @"%@", trimmed string];

Any ideas??

  • 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-18T10:29:51+00:00Added an answer on June 18, 2026 at 10:29 am

    You could use regular expressions to extract the numbers:

    NSString *string = ...; // Your string
    NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"Y = (\\d+.\\d+) X = (\\d+.\\d+)" options:0 error:NULL];
    NSTextCheckingResult *match = [regex firstMatchInString:string options:0 range:NSMakeRange(0, [string length])];
    if (match) {
        NSRange yRange = [match rangeAtIndex:1];
        NSString *yString = [string substringWithRange:yRange];
        NSRange xRange = [match rangeAtIndex:2];
        NSString *xString = [string substringWithRange:xRange];
    
        NSLog(@"X = %@, Y = %@", xString, yString);
    }
    

    Output:

    X = 207.500000, Y = 295.000000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NSString which looks like this: http://fiskltd.com/components/com_jshopping/files/img_products/thumb_09afd9f041af34fb0cffec1e0b1222e8.jpg And I need extract from
I've an iPhone applications with 2 models, Category and Content, which have a many-to-many
I have many buttons in my layout and they work well. I want to
Well, I know it may sounds basic, but I have literally been looking everywhere
i have two entities named UserInfo and Department which having to-one and to-many relations
I have an app which lists many languages. In the app I compare language
I have a Core Data model setup like so: Blockbuster Entity To-Many relationship to
I have an NSString which has escape characters etc in it. I need to
I have an object which straight forward instance variables. Some are NSString, some are
I have a UITableView which I populate using a NSMutableArray . This tableview updates

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.