Course Recommendation:

VBScript Split Function

Definition and Usage

The Split function can return a one-dimensional array based on 0, which contains the specified number of substrings.

Syntax
Split(expression[,delimiter[,count[,compare]]]) Parameters
Description Required. The string expression that contains the substring and delimiter.
delimiter Optional. Specifies the character used to identify the boundary of the substring. The default is a space character.
count Optional. Specifies the number of substrings to be returned. -1 indicates returning all substrings.
compare

Optional. Specifies the string comparison type to be used.

The following values can be used:

  • 0 = vbBinaryCompare - Execute binary comparison.
  • 1 = vbTextCompare - Execute text comparison.

Instance

Example 1

dim txt,a
txt="Hello World!"
a=Split(txt)
document.write(a(0) & "<br />")
document.write(a(1))

Output:

Hello
World!