replaceAt

Synopsis

$ replaceAt("string", "new", index, [n])

Replaces n characters starting at the specified index with the new string.

Parameters

"string" - the string to replace text in.

"new" - the new string to insert into the "string".

index - the index to insert the new string into

n - number of characters to remove starting at the index (defaults to length of "new")

Returns

A scalar string.

Examples

$string = "this is a test, really"; $string = replaceAt($string, "drill", 10, 4); println($string);

this is a drill, really

See Also