I need to trim the extra white spaces while parsing the content from an XML in android? I'm using regular expression for this for removing the spaces between end tag and start tag My code is:
topicValue.replaceAll(">\\s+<", "><").trim();
But for getting the number bullets for the subtopics, the space is not removed correctly!! Now its appearing like this.. Not in separate line and also white space before the numbers. eg: 1. abcd 2. efgh 3.ijkl
Suggest any idea for this.. Thanks for help!!
Got the solution!! Code is:
Reference link: Strip Leading and Trailing Spaces From Java String
Thanks for help!!