ReplaceStr

ReplaceStr

%ReplaceStr function


Function

The function replaces one substring by other one in the input string.

Declaration

TEXT %ReplaceStr( TEXT in text, TEXT in sub1, TEXT in sub2, BOOL in ReplaceAll )

Parameters

text

Text.

sub1

String that to be replaced by a new one.

sub2

String that replaces the previous one.

timeA

@TRUE - replace all occurrence of sub1.
@FALSE - replace the first occurrence from the left only.

Example

%ReplaceStr("Name : % or %","%","John",@FALSE) ; returns text: "Name : John or %" %ReplaceStr("Name : % or %","%","John",@TRUE) ; returns text: "Name : John or John"