3.5.5.21 Replace

Description

This function is used to replace n characters in string within$, starting at StartPosth position with string replace$. replace$ may be different length than n.

Syntax

 string Replace(string within$, int StartPos, int n, string replace$)$

Parameters

within$

The containing string that will be partially replaced.

StartPos

The starting position of the string to be replaced.

n

The number of characters to replace.

replace$

The replacing string.

Return

A new string containing replace$.

Example

string nn$=Replace("abcdefghijklmn",3,5,123456)$;
nn$=; //Should return "ab123456hijklmn".

See Also

Substitute