views:

195

answers:

1

I am new to iphone Development.I want to remove excess blank space in between the tags and extract only the content in xml parsing.My XML file is like

<entry>
<title>This is sample test</title>
<published>xxxxxxxx</published>
<summary>                                       This is summary                             </summary>
</entry>

I am able to parse the XML file and display all the contents.Since there is blank spaces in the front and end of summary content,due to this only blank space is displayed with the word "this".I want to remove the blank space and display "This is summary". Please help me out .Thanks.

+1  A: 

You can trim abundant spaces using - (NSString *)stringByTrimmingCharactersInSet:(NSCharacterSet *)set method:

NSString* newString = [myString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
Vladimir
Thanks pal.I have used the above method while appending my string in found character method.It works fine.Thanks.
Warrior