How can I write a newline in a string in ColdFusion?

前端 未结 7 968
孤街浪徒
孤街浪徒 2021-02-03 20:58

Currently I\'m putting newlines in strings through one of these two methods:



        
7条回答
  •  终归单人心
    2021-02-03 21:19

    I was looking for a way to output a new line in , so I figured I'd leave my answer for anyone else who arrived in a similar fashion:

    writeDump(variable); // writeDump will not produce a new line.
    writeOutput("
    "); // you have to use writeOutput.

    writeOutput appends to the page-output stream as html, so you need to write html for it to output (this means you can also include   to add spaces for indentation).

提交回复
热议问题