|
» |
|
|
|
String insert.
Returns a string after inserting another string into the source string. Syntax | |
strins (insert source position)
|
Formal Declaration | |
strins:str (insert:str source:str position:u16)
|
Parameters | |
- insert
The string to be inserted into source.
- source
The source string into which insert is to be inserted.
- position
The position where insert is to be inserted in source.
String indices are 1-based. (That is, indices are 1, 2, 3, ...
rather than 0, 1, 2, ...) If position is greater
than the string length of source,
insert is appended to source.
Examples | |
$nmdebug > var name "Smith, "
$nmdebug > wl strins(name, "Dear Ms. How are You?", 10)
Dear Ms. Smith, How are You?
|
Insert the string variable NAME into a literal string at position 10.
$nmdebug > wl strins(" NOW!", "Go Home", 100):"qo"
"Go Home NOW!"
|
Insert "NOW!" into the source at position 100. Since the source is only seven
characters long, "NOW!" is appended at the end of the source string.
Limitations, Restrictions | |
If the resultant string is larger than the maximum supported string length
(see the STRMAX function), it is truncated.
|