VBScript Tutorials - Herong's Tutorial Examples - v6.02, by Herong Yang
String Data Literals
This section provides rules on writing String data literals, characters enclosed in double quotes.
In the previous section, we learned that a String data literal is a sequence of characters enclosed in double quotes ("), like "Hello".
But there is one additional rule about String data literals:
I have the following script, string_literal.html, to show you how to include double quotes in string literals:
<html> <body> <!-- string_literal.html - Copyright (c) 1998 HerongYang.com. All Rights Reserved. --> <pre> <script language="vbscript"> document.writeln("Ding...") document.writeln("He said: ""Hello?""") document.writeln("She said: ""Hello, Who's calling?""") </script> </pre> </body> </html>
Here is the output of the sample script:
Ding... He said: "Hello?" She said: "Hello, Who's calling?"
By the way, VBScript does not support string literals with single quotes (').
Table of Contents
Introduction of VBScript - Visual Basic Scripting Edition
►Variant Data Type, Subtypes, and Literals
"Variant" - Data Type and Subtypes
Numeric Comparison Operations and Logical Operations
String Operations - Concatenation and Comparison
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
Inspecting Variables Received in Procedures
Error Handling Flag and the "Err" Object
Regular Expression Pattern Match and Replacement
scrrun.dll - Scripting Runtime DLL Library
IE Web Browser Supporting VBScript