Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在不使用任何 HTML 实体或标签的情况下将换行符编码为字符串?具体来说,我想要一个传递给 dojox.gfx 渲染器的字符串来显示换行符。
您可以使用\nor对其进行转义\u000A,请参见:
\n
\u000A
如何在 JavaScript 中的多行代码中拆分字符串?