By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,654 Members | 1,517 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,654 IT Pros & Developers. It's quick & easy.

remove white spaces in html page while parsing.

P: 20
can any one help me??

i have an html page.. i want to parse the html page using htmlparser library.


while parsing it should not consider whitespaces and newline..
Mar 12 '12 #1

✓ answered by r035198x

Maybe you can configure the parser methods to ignore the white spaces?
Or maybe you can do a simple check on the string before printing it by doing if(string.trim().equals("")).

Share this Question
Share on Google+
3 Replies


10K+
P: 13,264
What exactly is the problem now, where are you stuck?
Mar 12 '12 #2

P: 20
while parsing, white spaces and newlines will be considered as string node.. other than white spaces, i need to print the string nodes.
Mar 12 '12 #3

10K+
P: 13,264
Maybe you can configure the parser methods to ignore the white spaces?
Or maybe you can do a simple check on the string before printing it by doing if(string.trim().equals("")).
Mar 12 '12 #4

Post your reply

Sign in to post your reply or Sign up for a free account.