NET/MASTER Network Control Language (NCL) Reference Manual

DELSTR
Built-in Functions
4–40 106126 Tandem Computers Incorporated
DELSTR The DELSTR built-in function deletes part of a string, starting at a specified character
position, for a specified length.
DELSTR(
string
,
n
[,
length
] )
string
specifies the string.
n
specifies the character position at which deletion starts.
n
must be a positive
whole number. If
n
specifies a character position beyond the end of the string, the
deletion is ignored.
length
specifies the number of characters to delete. If this operand is not specified or is
greater than the length of the string, all characters from character position
n
to the
end of the string are deleted.
length
must be a positive whole number.
Consideration
See also DELWORD and SUBSTR. The DELWORD built-in function deletes a
specified number of words from a string. The SUBSTR built-in function extracts a
substring from a string.
Examples
In the following example, NCL deletes all characters from character position 3 through
the end of the string (
length
not specified). The output string is “AB”:
SAY DELSTR(ABCDE,3)
In the following example, NCL deletes all characters from character position 3 through
character position 4 (
length
=2). The output string is “ABE”:
&A = ABCDE
&B = 3
&C = 2
&RESULT = DELSTR(&A,&B,&C)
In the following example, NCL deletes no characters from the string, because character
position 6 is beyond the end of the string. The result is “ABCDE”:
SAY DELSTR(ABCDE,6,2)