Extract

The Extract function extracts a word from a string.

Syntax

The Extract function has the following syntax:

String = Extract(Expression, Index, [Delimiter])

Parameters

The Extract function has the following parameters.

Table 1. Extract function parameters

Parameter

Format

Description

Expression

String

String expression from which to extract strings.

Index

Integer

Word position of the substring, where 0 indicates the first word.

Delimiter

array

Array of characters that separate words in the string. Default is an array with the space character as the single element.

Return value

The extracted substring.

Example

The following example shows how to extract a word from a string.

MyString = "This is a test.";
MyWord = Extract(MyString, 1, " ");
Log(MyWord);
					
MyString = "This|is|a|test.";
MyWord = Extract(MyString, 3, "|");
Log(MyWord);

This example prints the following message to the policy log:

Parser Log: is
Parser Log: test.