How to remove paragraph containing \r

Hi,

Im doing search.replace method.
I have org. template with for ex: \r.
Now when i have empty content for i want to remove the hole line.

I have tried replace on “\r”, “”, that does not work.
I have tried node.remove(), but cant use cause the node does not have parrent.
How do i remove that perticcular paragraph with just a line break?

Regards,
Karan

Hi

Thanks for your request. Why don’t you use Mail Merge to fill your document with data? In case of using Mail Merge, you can use RemoveEmptyParagraphs option and empty paragraphs will be automatically removed.
https://reference.aspose.com/words/net/aspose.words.mailmerging/mailmerge/cleanupoptions/
Also, I think, Mail Merge is the better approach than “find & replace”. Please see the following link to learn more about Mail Merge:
https://docs.aspose.com/words/net/types-of-mail-merge-operations/
Best regards.