index

Varkon MBS Programmers manual

# substr - Function

## Description

Creates a new (sub-) string by copying one or more characters from an existing string.

## Syntax

      s2:=substr(s1, start, count);

      string s2;
      string s1;
      int    start;
      int    count;

## Principal parameters

s1 | - 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 STRING value equal to the new string.

## Examples

      s2:=substr("ABCDE",2,3);   ! Equal to s2:="BCD";

      s2:=substr("ABCDE",4,1);   ! Equal to s2:="D";

      s2:=substr("ABCDE",3);     ! Equal to s2:="CDE";

      s2:=substr("ABCDE",1);     ! Equal to s2:="ABCDE";

Varkon version 1.19C svn# 120