Substitute

Contents

Description

Substitute find$ with sub$ when found in within$.

Syntax

string Substitute(string within, string sub, string find[, int n = 0])

Parameters

within

A string probably including string find.

sub

A string used to replace string find.

find

The string to find.

n

n=0 Substitute all, otherwise only nth instance.

Return

Return the new string replaced find$ by sub$ in within$.

Example

string new$=Substitute(abcdefabcdef,12,bcd,0)$;
new$=; //Should return a new string: "A12EFA12EF".

See Also

Replace, Exact