VARKON Version 1.15 1997-10-24


substr - Function

Extracts a part of a string


Description

Creates a substring by copying one or more characters from another string.

Syntax

substr(str, start, count)

STRING str*132;
INT start;
INT count;


Principal parameters

str - The original string
start - Position of first character to copy, 1<= start <=132


Optional parameters

count - Number of characters to copy, default is the rest of the string


Return value

A new STRING.

Examples

substr("ABCDE",2,3) = "BCD"

substr("ABCDE",4,1)" = "D"

substr("ABCDE",3) = "CDE"

substr("ABCDE",1) = "ABCDE"


VARKON Homepage Index