Icon StrReplace

Unit: WebCore

Available In: Client and Server Applications

function StrReplace(const Value: String; const SearchValue: String;
                    const ReplaceValue: String;
                    ReplaceAll: Boolean=False;
                    CaseInsensitive: Boolean=False): String

The StrReplace function searches for the SearchValue input parameter in the Value input parameter and replaces it with the ReplaceValue input parameter. If the optional ReplaceAll input parameter is True, then all occurrences of the SearchValue input parameter are replaced with the ReplaceValue input parameter. If the optional CaseInsensitive input parameter is True, then the search for the SearchValue input parameter will be case-insensitive. The return value is the modified String value.

Examples

X := StrReplace('abcdefghijk', 'd', ' ', True, True);  // X is 'abc efghijk'
Image