Click here to return to the KiXtart HelpDesk main page...

KiXtart 2001 Manual

Substr( )

Action: Returns part of a string.
 
Syntax: SUBSTR ("string", start, length)
 
Parameters: String

The string from which to extract a substring.

Start

Numeric value representing the offset (from the left) in the string where the substring begins.

Length

Optional numeric value representing the length of the substring. If omitted or if there are fewer than Length characters in the text (including the character at start), all characters from the start position to the end of the string are returned.

Returns: The substring indicated by start and length.
 
See Also: InStr( ), InStrRev( ), Left( ), Right( )
 
Example:

; get the last 2 chars of the userid
$x = SUBSTR(@USERID, LEN(@USERID) - 2, 2)