Is there "\n" equivalent in VBscript?

Carlos Blanco picture Carlos Blanco · Feb 4, 2010 · Viewed 110.7k times · Source

I want to use the Replace function in VBScript to replacea all line breaks in a string for "\n". I come from java, so using \n inside a string means a line break.

Is there an equivalent in VBScript?

Answer

Fionnuala picture Fionnuala · Feb 4, 2010

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)