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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:02:09+00:00 2026-06-13T10:02:09+00:00

I have already looked at this question but there was no solution. Here is

  • 0

I have already looked at this question but there was no solution.
Here is the problem.

po [myNumberFormatter stringFromNumber:myNumber]

Output–> (id) $4 = 1.500,00

p (char) [(NSString *)[myNumberFormatter stringFromNumber:myNumber] characterAtIndex:1]

Output–> (char) $5 = ‘\xa0’

po [(NSString *)[myNumberFormatter stringFromNumber:myNumber] stringByReplacingOccurrencesOfString:@"\xa0" withString:@" "]

Output–> (id) $6 = 1.500,00

One thing to note though is that on the screen, the value 1.500,00 looks like 1 500,00.
But is there any way to convert the ‘\xa0’ character to a @" " within the string?

This following solution already works, but it has the problem of converting everything not included into a blank character.

po [(NSString *)[myNumberFormatter stringFromNumber:myNumber] stringByReplacingSequenceOfCharactersInSet:(NSCharacterSet *)[[NSCharacterSet characterSetWithCharactersInString:@"0123456789,."] invertedSet] with:@" "]

Edit ————–

I’ve tried the answer below and i thought it was wrong becuase

po [(NSString *)[numberFormatter stringFromNumber:theNumber] stringByReplacingOccurrencesOfString:@"\u00a0" withString:@" "] 

still produced the same result (the \xa0 char was still not removed). But when I did not place it in the debugger, but instead placed it in a NSString within the code, the correct answer was stored and the \xa0 character was removed. Guess I should not depend on debugger log alone.

  • 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-13T10:02:10+00:00Added an answer on June 13, 2026 at 10:02 am
    NSString *str = // string to cleanup
    str = [str stringByReplacingOccurrencesOfString:@"\u00a0" withString:@" "];
    

    The \u00a0 will get replaced at compile time with an actual no-break space.

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

Sidebar

Related Questions

I have already looked at this similar question but i am still wondering if
Quick question (and sorry if it's already been asked, I have looked but couldn't
I have read several questions on this already, but I have tried their solution
Before I posted this question, I already looked this , but I couldn't get
I have already read some posts, but no one helped me with my problem.
I saw this question already, but it doesn't explain what I am wondering about.
I realize that this question has been answered before, and I have looked through
I've already looked at this question , and I've already checked out the suggestions
i know, similar questions have been asked, and i've already looked through everything i
I have already pushed all the changes to the server. Here is the order

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.