Hi all
im Implementing wordcount feature in my appliction it counts the numberof lines in the document,number of pages, number of charecters with space and without space,
numberof paragraphs in the document

i implemented this function it is working fine but the problem is becoz of loops and im checking each charecter, so if the document is too long say 30 or more pages my apliction get hangs.
so any bady is having the idea to implement it another way?
any advice is welcome
thnks...

Well what way do you have it now?

Also be sure to optimize your code as well ie use stringbuffer instead string +, you know the usuals. When you are comparing characters, you might be running into speed and performance issues when you get into the larger documents.

Post the code and lets take a look.

Thanks for ur response
i got the solution for It. but only thing is i need to count the number of paragraphs in the document. any bady knows how to count the number of paragraphs in the document?

Depending upon the document, you can check for paragraph separator character

0x2029

Otherwise, you might need to check for multiple carriage returns, line feeds, depending upon how your document is saved.

Ya i tried doing this the problem is,
if user enters the blank lines by pressing enter key it counts as paragraph only.
so any other solutions?

Hi all.
Thanks for ur response... Finally i got the solution for it....


thnks again.

This question has already been answered. Start a new discussion instead.