Free Support Forum -

\n characters in setText()

I have an instance of Run node and want to replace it’s text by using setText():
Run run = …
String str = …

This works fine, unless text contains \n characters. How can I replace text of Run node and make \n characters work the same way they work for plain text?


<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. I think, you can try replacing \n character in the string with com.aspose.words.ControlChar.LINE_BREAK.

Best regards,