LISTSERV Maestro 11.1-3 Help Table Of Contents

Calculation Formulas

Back to Calculation Formulas Overview
Back to Functions Overview


Function "Substring"

Substring(originaltext, startindex [, endindex])

Function: Returns a text substring that has been extracted from the given original text string according to the other argument(s) as specified:

The substring begins with the character in "originaltext" at the position specified by "startindex".

If no "endindex" is given, the substring extends to the end of the original string. If "endindex" is given, the substring extends to the character at position "endindex - 1" (i.e. the character at "endindex" is the first character that is not part of the substring).

Note: All indices are zero-based. The index of the last character in the original string is at the position "length of original string minus 1".

Return-Type: Text

Arguments:
originaltext - Type Text: The original text string from which the substring will be extracted.
startindex - Type Number: The beginning index, inclusive, zero-based.

(The third argument is optional)

endindex - Type Number: The ending index, exclusive, zero-based.

Examples:
Substring("original text", 5)
Substring("original", 3, 3 + &VALUE;)

© 2002-2023 L-Soft Sweden AB. All rights reserved.