SHARE
Facebook X Pinterest WhatsApp

ASP Q&A: The VBScript NewLine Character

This is the fifth in a series of tips being posted based on the most read posts in one of our ASP Forums. (Previous Q&A) Problem / Question: How do you insert a new line when using VBscript? For example in JavaScript you can do the following: Response.Write (“Here is my sentence .n”); where n” […]

Written By
thumbnail
CodeGuru Staff
CodeGuru Staff
Oct 19, 2016
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

This is the fifth in a series of tips being posted based on the most read posts in one of our ASP Forums. (Previous Q&A)

Problem / Question:

How do you insert a new line when using VBscript? For example in JavaScript you can do the following:

Response.Write ("Here is my sentence .n");

where n” outputs a new line.

What is the syntax for VBscript?

Solution:

For VBScript, the approach would be to use vbCrLf:

Response.Write ("Here is my sentence" & vbCrLf)

The vbCrLf equates to doing a Chr(13) + Chr(10) combination. You could also use vbNewLine, which is replaced with whatever value the platform considers a newline. On Windows, the result of vbCrLf and vbNewLine should be the same.

Based on posts by forum members at ASPMessageBoard

Recommended for you...

Different Types of JIT Compilers in .NET
Tariq Siddiqui
Mar 17, 2023
Middleware in ASP.NET Core
Tariq Siddiqui
Mar 16, 2023
Intro to Intel oneDAL and ML.NET
Hannes DuPreez
Jan 16, 2023
Types of Query Execution in LINQ
Tariq Siddiqui
Dec 15, 2022
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.