VBScript Operators

A list of operators available in VBScript.

In previous lessons, we've used the "equals" operator to assign a value to a variable. We've also used it to perform a test against a given condition (for example, the If statements).

In VBScript, operators are used to perform an operation. For example, an operator could be used to assign a value to a variable. An operator could also be used to compare two values.

Below is a listing of VBScript operators and a brief description of them. Don't worry if you don't understand all of them at this stage - just bookmark this page for reference and return whenever you need to.

Artithmetic Operators

OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
\Integer Division (divides two numbers and returns an integer result)
ModModulus (remainder of a division)
^Exponentiation (raises the number to the power of an exponent)

Assignment Operator

OperatorDescription
=Assign

Comparison Operators

OperatorDescription
=Is equal to
<>Is not equal to
>Greater than
>=Greater than or equal to
<Less than
<=Less than or equal to

Logical Operators

OperatorDescription
AndPerforms a logical conjunction on two expressions (if both expressions evaluate to True, result is True. If either expression evaluates to False, result is False)
OrPerforms a logical disjunction on two expressions (if either or both expressions evaluate to True, result is True).
NotPerforms logical negation on an expression.
XorPerforms a logical exclusion on two expressions (if one, and only one, of the expressions evaluates to True, result is True. However, if either expression is Null, result is also Null).

Concatenation Operators

OperatorDescription
&Concatenate (join two strings together)
+Adds two numbers together