String Concatenation Operation

This section provides a quick introduction of string concatenation operation, which joins the second string to the end of the first string.

String concatenation operation is an operation that:

Here is a tutorial example showing you how string concatenation operation works:

<!-- string_concatenation.html
 - Copyright (c) 2015,, All Rights Reserved.
<script language="vbscript">
   document.writeln("Hello " & "world!")
   document.writeln("649 = " & 649)
   document.writeln("True = " & True)
   document.writeln("#31-Dec-1999# = " & #31-Dec-1999#)
   document.writeln("Empty = " & Empty)
   document.writeln("Null = " & Null)
   document.writeln("Hello " + "world!")
   document.writeln("649 " + 649)
'   document.writeln("Game " + 649)

Here is the output of this VBScript example script:

Hello world!
649 = 649
True = True
#31-Dec-1999# = 12/31/1999
Empty = 
Null = 
Hello world!

The output confirms some of string concatenation operation rules:


Table of Contents

 About This Book

 Introduction of VBScript - Visual Basic Scripting Edition

 Variant Data Type, Subtypes, and Literals

 Arithmetic Operations

 Numeric Comparison Operations and Logical Operations

String Operations - Concatenation and Comparison

String Concatenation Operation

 String Comparison Operation

 Variable Declaration and Assignment Statement

 Expression and Order of Operation Precedence

 Statement Syntax and Statement Types

 Array Data Type and Related Statements

 Array References and Array Assignment Statements

 Conditional Statements - "If ... Then" and "Select Case"

 Loop Statements - "For", "While", and "Do"

 "Function" and "Sub" Procedures

 Built-in Functions

 Inspecting Variables Received in Procedures

 Error Handling Flag and the "Err" Object

 Regular Expression Pattern Match and Replacement

 scrrun.dll - Scripting Runtime DLL Library

 Creating Your Own Classes

 IE Web Browser Supporting VBScript

 IIS ASP Server Supporting VBScript

 WSH (Windows Script Host)


 Full Version in PDF/EPUB