We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Remove the \r at the end of a Paragraph's GetText()

Hello!

I am using the Aspose.Words .NET package to parse templates and create files. Seems to be working pretty well.

I have HTML that I insert into the document, and it works. Except that it adds a “\r” character to the end of the Paragraph. On occasion, I need to remove this carriage return. What is the best way to do so?

I tried checking the Run objects under the Paragraph, but they did not contain this “\r”, so that didn’t work.

I can do a GetText() on the Paragraph, and it does contain a “\r”, but if I use the DocBuilder to re-add that text (without the “\r”) I lose all the text’s formatting, so that doesn’t work.

I tried manipulating the SpaceAfterAuto and SpaceAfter and NoSpaceBetweenParagraphsOfSameStyle options on the ParagraphFormat to no avail – none of them did what I wanted.

And I can’t remove all the “\r” characters in the Paragraph – only the last one.

Any help is appreciated,

Jesse

@jsierks

Thanks for your inquiry. We will appreciate it if you please share your input and expected output document as ZIP file here. We will look into it and will guide you accordingly.