beautypg.com

Atstr – Visara Master Console Center Scripting Guide User Manual

Page 82

background image

Chapter 5 Script Commands

Scripting Guide

82

ATSTR

Syntax:

ATSTR( $String, $Substring) ==> %StartPos

Description:

Returns the starting position of a substring within a string.

Action:

String is searched using the regular expression pattern Substring. The

starting position of the matching text is returned.

Parameters:

$String. String expression. The string to search for the pattern in.
$Substring. Regular expression. The regular expression pattern to
search for in String. Refer to Expressions on page 41 for more

information.

Returns:

Numeric value, as follows:
Value Meaning
0

No match found

Any other value

The starting position of the first instance of the

matching text within String

Notes:

N/A

Example:

$String := “The quick brown fox.”
$Substring := “brown”
%StringPosition := ATSTR ( $String, $Substring )

// %StringPosition == 11

See Also:

FINDSTR, LEFTSTR, RIGHTSTR, REPSTR, SUBSTR, LEFTSTR