_@SUBSTR

_@SUBSTR function is used in a Logic Template to extract a string from within another string. The original string, the location within the string to begin copying, and the number of charcters to copy are passed as arguments to the function.

If the value of 1 is passed for the location to begin copying, copying begins with the first character. If a value of 2 is passed for the location to begin copying, copying begins with the second character. And, so on.

If the location to begin copying is identified as zero or exceeds the number of characters in the original string, nothing is copied.

If the number of characters to copy exceeds the number of characters remaining in the original string, only the remaining characters in the string are copied.

Returns

Description

The sub string.

Format
_@SUBSTR
( string, start, length );

Argument

Description

string

The string literal or the name of the string data field from which to extract the substring.

start

The location within the string containing the first character to be copied to the substring. A value of 1 indicates start with the first character.

length

The number of characters to be copied from the string to the substring.

Example
//Create a new file path using _@CAT with the base path "/data/test/" and the file name from the orginal path

NewPath = _@CAT( "/data/test", _@SUBSTR( Path, 16, 255 ) );