
substring - extracting a substring

Calling sequence:
substring(string, integer_1, integer_2)

Parameter:
string                  --  string
integer_1, integer_2    --  non-negative integers

Overloading:

all

Summary:

substring(string, pos, len) returns len characters of the character string
string starting at position pos.  The first character of string has the
position 0.  The sum pos + len has to be smaller or equal to the length
of string, i.e. smaller or equal to strlen(string).

substring returns an error if the arguments integer_1 and integer_2
are not non-negative integers.  If these arguments do not specify a proper
substring then the error Invalid index is returned. substring is a kernel
function.

>>  substring("Hello World", 0, 5);

      "Hello"

>>  substring("This is a string", 5, 4);

      "is a"

See also:  strlen , strmatch

