I had to use vbLf only in an ASP script where the original data was POSTed from a PHP script on a cPanel box over to ASP on a win server
(VBScript)
EmailText = Replace(EmailText, vbLf, "<br>")
This page has a table of string constants including vbCrLf
vbCrLf
| Chr(13) & Chr(10) | Carriage return–linefeed combination
I think it's vbcrlf
.
replace(s, vbcrlf, "<br />")
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
).
Source: Stackoverflow.com