Is there "\n" equivalent in VBscript?
This page has a table of string constants including vbCrLf
vbCrLf
| Chr(13) & Chr(10) | Carriage return–linefeed combination
For replace you can use vbCrLf
:
Replace(string, vbCrLf, "")
You can also use chr(13)+chr(10)
.
I seem to remember in some odd cases that chr(10)
comes before chr(13)
.
Tried and tested. I know that this works:
Replace(EmailText, vbNewLine, "<br>")
i.e. vbNewLine
is also the equivalent of \n
As David and Remou pointed out, vbCrLf
if you want a carriage-return-linefeed combination. Otherwise, Chr(13)
and Chr(10)
(although some VB-derivatives have vbCr
and vbLf
; VBScript may well have those, worth checking before using Chr
).