SubStr

(Engine-Level Function)

Description: Returns a string that is a portion of another string.
Returns: Text
Usage: Script or steady state.
Function Groups: String and Buffer
Related to: Concat | StrLen | Replace
Format: SubStr(String, Start[, Length])
Parameters:  
String
Required. Any text expression giving the original string to extract the sub-string from.
Start
Required. Any numeric expression giving the character offset from the start of String of where to start the resulting string. A value of 0 refers to the first character in String. If the Start is past the end of String, the result is invalid.
Length
Optional. Any numeric expression giving the number of characters to include in the resulting string starting with Start. Defaults to string length.
Comments: If any parameter of this function is invalid, the return value is invalid. If length exceeds the remaining number of characters in the string past Start, then only the remaining characters will be returned.

Examples:

piece1 = SubStr("ABCDEF", 2, 3);
piece2 = SubStr("ABCDEF", 3, 4);

The values of piece1 and piece2 are "CDE" and "DEF" respectively.