RAD function: strchrcp

A RAD function that replaces part of a string with copies of another string.

Function

strchrcp

Format

$L.void=strchrcp($target, $index, $source, $copies)

Parameters

The following values are valid for the strchrcp function:

Parameter Data type Description
$L.void= Not applicable. A syntax requirement only, does not affect the outcome of the function.
$target String The string being modified.
$index Number The position in $target to begin copying $source.
$source String The string to be copied into $target.
$copies Number The number of copies of $source to replicate within $target.

Factors

This function never extends the length of $target.

Example

$target="Hewlett-Packard"
$index=4
$source="falcon"
$copies=2
$L.void=strchrcp($target, $index, $source, $copies)

After execution, the value of $target is Hewfalconfalcon.