Substring

Top  Previous  Next

 

The Substring Special Function Command allows you to retrieve a substring from a specified string.

lamp Important: Special Function commands can only be used on the right hand side of a Variable Assignment command.

Command Syntax

 

Substring,[OriginalString],[Index],[Length]

 

The comma character after the command is compulsory as are all three parameters and the commas separating them.

 

Parameters:

 

OriginalString: The string from which to retrieve the substring

Index: The zero based integer value representing the point at which to start the substring

Length: An integer representing the number of characters to include in the substring starting at the position indicated by Index

 

All three parameters are compulsory. If any required parameter is missing or invalid an error will be thrown.

 

Example:

 

Var:ShortString=Substring,This is the original string,0,4 //returns 'This'

lamp Important: If you assign an index greater than the length of the original string an error will be thrown. .

See Also: Special Functions Replace GetFileVersion