VBScript Trim Function

Definition and Usage

The Trim function can remove spaces from both sides of the string.

Syntax

Trim(string)
Parameter Description
string String Expression.

Instance

Example 1

dim txt
txt="  This is a beautiful day!  "
document.write(Trim(txt))

Output:

"This is a beautiful day!"