string.sub

Syntax

s := string.sub(source,istart<,inum>) := s

Get/sets a sub-string of the string source, starting at position istart and including inum characters.

If inum is -1 (the default) the entire rest of the string after istart will be included.

Note that on assignment, the length of the string replaced does not have to match the length of the string removed.

Returns:

s - The sub-string of the input string.

Accepts:

s - A string that will over-write the sub-string of the input string.

Arguments:

source - The original input string istart - The starting index of the substring (base 1). inum - The number of characters in the substring.