how can i replace String with another String and if replacement String contains ‘\n’ then place text after \n to next paragraph with same format in docx. replacement string may also contain \t.
Also want to know what is ControlChar.LINE_FEED and ControlChar.LINE_BREAK and their impact.
currently if i directly pass replacement as shown in below code.
doc.getRange().replace(“mad”, “abc\nxyz”, new FindReplaceOptions(FindReplaceDirection.FORWARD));
then there is some space shown on ms word and soft enter in libre-office.
Thanks for your inquiry. The ControlChar class control characters often encountered in documents. The ControlChar.LineBreak represents line break character and ControlChar.LineFeed represnt line feed character.
You can replace “\n” with ControlChar.ParagraphBreak using Range.Replace method. If you still face problem, please share your input and expected output documents here for our reference. We will then provide you more information on this.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.