Asp-Classic

ASP 換行符 - n?

  • August 31, 2018

我一直在尋找一種在查看原始碼時在程式碼中插入換行符的方法。我不是在尋找<br />

類似於 PHP 的東西\n

關於如何在 ASP 中執行此操作的任何想法?我將把它放在一個字元串中。

沒有辦法在字元串中做到這一點。您必須像這樣附加 vbCrLf:

Response.Write "hello" & vbCrLf & "world"

如果你想將它包含在字元串中,你可以像這樣進行替換:

output = "hello\nworld"
output = Replace(output, "\n", vbCrLf)
Response.Write output

除了**\n方法之外,我還嵌入了 HTML 標籤<BR>**並使用了:

Response.Write "First Line Of Text<br>Second Line Of Text<br>Third line Of Text"

引用自:https://stackoverflow.com/questions/366968