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.
I found out how to make it work. I did it in 3 messages to remove Tabs, New Lines, and Spaces:
Note: string is an NSMutableString