beautypg.com

Split – Visara Master Console Center Scripting Guide User Manual

Page 191

background image

Chapter 5 Script Commands

Scripting Guide

191

SPLIT

Syntax:

SPLIT( $Array, $String, $Delimiter)

Description:

Populates an array with the fields of a string delimited by a string.

Action:

String is divided into fields by the Delimiter expression. Each field,

from left to right in String, is placed into its corresponding array
element in $Array. The first field is placed in $Array[ 1], the second

field is placed in $Array[ 2], and so on.

Parameters:

$Array. String normal array variable. The array to populate with the
field results.
$String. String expression. The string to split into fields.
$Delimiter. String expression. The string pattern (one or more

characters) that divides the String into fields. The Delimiter

expression result characters will not be a part of any field. A single
space is a special delimiter that causes a contiguous sequence of spaces

in String to be reduced to one space before splitting. This special

handling eases the manipulation of host messages that often have
multiple spaces between words.

Returns:

N/A.

Notes:

Determine the number of fields created with the ALEN() function.

Example:

SPLIT( $Array, $Text, “:”)

See Also:

JOIN