NET/MASTER Network Control Language (NCL) Reference Manual

INSERT
Built-in Functions
4–44 106126 Tandem Computers Incorporated
INSERT The INSERT built-in function inserts one string into another.
INSERT(
new
,
target
[, [
n
] , [
length
] [,
pad
] ] )
new
specifies the string to be inserted.
target
specifies the string into which
new
is to be inserted.
Note
target
remains unchanged; it does not receive the result of any insertion.
n
specifies the character position at which
new
is to be inserted. If 0 (zero) is
specified,
new
is inserted at the front of
target
.
n
must be a positive whole
number. If
n
is larger than the length of
target
,
target
is padded with spaces
(the default) to the right, until it is equal to the length of
n
.
length
specifies the length of the string to be inserted into
target
.
new
is padded with
spaces (the default) to the specified length, if it is shorter than
length
. If
new
is
longer than
length
,
new
is truncated.
length
must be a positive whole number.
pad
specifies the character to be used to pad the string. The default is a space.
Consideration
See also DELSTR and SUBSTR. The DELSTR built-in function deletes part of a string
from a specified position. The SUBSTR built-in function extracts a substring from a
string, starting at a specified position.
Examples
In the following example, NCL inserts one space into the string “abcdef” at character
position 3. The output string is “abc def”:
SAY INSERT(" ",abcdef,3)