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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:29:37+00:00 2026-06-03T03:29:37+00:00

So I have a small project that parses through an XML file. I am

  • 0

So I have a small project that parses through an XML file. I am trying to format the string so that it has no indents before or after.

Some of the xml is:

  <master_url>
    <base_url>      http://buildmac.ee.ps.edu/~wsn/boin/    </base_url>
<request_task>
<name>request_task</name>
<field>username</field>
</request_task>
...

Before format I have:

2012-04-30 21:42:34.684 XMLParser[33194:b303] string = 
        http://buildmac.ee.ps.edu/~wsn/boin/

This is how I am trying to format it:

[nodecontent appendString:[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];

Afterward, it only contains a blank string “” in nodecontent.

It works for every other element except for that webaddress because it is awkwardly indented

I’m pretty new to Objective C and Xcode so I’m sorry if this is a dumb question, but none of the posts I looked at fixed my issue.

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

    I found out how to make it work. I did it in 3 messages to remove Tabs, New Lines, and Spaces:

    string = [[string stringByReplacingOccurrencesOfString: @"\n" withString: @""] mutableCopy];
    string = [[string stringByReplacingOccurrencesOfString: @"\t" withString: @""] mutableCopy];
    string = [[string stringByReplacingOccurrencesOfString: @" " withString: @""] mutableCopy];
    

    Note: string is an NSMutableString

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

Sidebar

Related Questions

I have a small racing project that uses a MySQL backend. I am trying
I am working on a small project that is receiving XML data in string
I have a small project that I will be working on shortly that collects
I have a small project and I noticed that I have a lot of
I have a small- to medium-size project that I am doing for my software
I have a small RIA that I built as a learning/make-my-life-easier project that uses
I have a small project that builds a number of targets from the same
I have a small project that uses libglade and use the following to load
I have a small project that will have 1 user on 1 computer. The
I have a small command line utility project that I'm using Maven to manage.

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.