Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there "\n" equivalent in VBscript?

I want to use the Replace function in VBScript to replace 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?

like image 208
Carlos Blanco Avatar asked Feb 04 '10 22:02

Carlos Blanco


People also ask

How do you do a line break in VBScript?

If you want to force a new line in a message box, you can include one of the following: The Visual Basic for Applications constant for a carriage return and line feed, vbCrLf. The character codes for a carriage return and line feed, Chr(13) & Chr(10).

What are the features of VBScript?

Features of VBScriptIt has a very simple syntax, easy to learn and to implement. Unlike C++ or Java, VBScript is an object-based scripting language and NOT an Object-Oriented Programming language. It uses Component Object Model (COM) in order to access the elements of the environment in which it is executing.

What is VB scripting language?

VBScript ("Microsoft Visual Basic Scripting Edition") is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers with error handling, subroutines, and other advanced programming constructs.


1 Answers

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).

like image 175
Fionnuala Avatar answered Nov 10 '22 12:11

Fionnuala