如何在 java 中的 XWPFDocument 中添加新行?
How to add a new line in XWPFDocument in java?
我想在 XWPFDocument 段落中创建一个换行符,我尝试了下面的代码,但它不起作用。
XWPFParagraph paragraph = document.createParagraph();
XWPFRun run = paragraph.createRun();
run.setText(" we strive hard to " +
"provide quality tutorials for self-learning " +
"purpose in the domains of Academics, Information " +
"Technology, Management and Computer Programming
Languages.");
document.write(out);
您可以拆分文本并使用
run.addBreak();
在中间添加一个中断
您可以使用 newline
字符:\n
.
我想在 XWPFDocument 段落中创建一个换行符,我尝试了下面的代码,但它不起作用。
XWPFParagraph paragraph = document.createParagraph();
XWPFRun run = paragraph.createRun();
run.setText(" we strive hard to " +
"provide quality tutorials for self-learning " +
"purpose in the domains of Academics, Information " +
"Technology, Management and Computer Programming
Languages.");
document.write(out);
您可以拆分文本并使用
run.addBreak();
在中间添加一个中断
您可以使用 newline
字符:\n
.