Utility Functions : Calling Utility Functions : Extract Portion of a String

Extract Portion of a String

The string_extract function extracts a portion of a string.

The syntax is as follows:

stm_string_extract (string, index, length, status)

In this syntax:

stm_string—Designates the function as a string manipulation function
extract—Signifies that the function extracts a portion of the input string
string—The input string
index—The integer location from which the output string portion starts
length—The output string length (integer)
status—One of the following status codes: stm_success, stm_null_string, stm_illegal_index, and stm_illegal_len

For example:

stm_string_extract(’ABCDE’,0,2,status) = ’AB’
stm_string_extract(’ABCDE’,3,2,status) = ’DE’
stm_string_extract(’ABCDE’,3,7,status) = ’’
and status = stm_illegal_len