$WBREPL - replace string

Availability
$WBREPL  is available for use with all WBSP commands:

Syntax
$WBREPL{sourcetext|stringtobereplaced|stringtoreplacewith|casesensitive}
$WBREPL[sourcetext|stringtobereplaced|stringtoreplacewith|casesensitive]

Parameters
sourcetext - text on which to perform the replacement
stringtobereplaced - text to be searched for inside sourcetext
stringtoreplacewith - text to replace for every successful match of stringtobereplaced in sourcetext
casesensitive - optional parameter  - if set to true (T,ON,1) WhizBase will perform case sensitive search (so "A" will not match "a")

Returns
A copy of sourcetext with every occurrence of stringtobereplaced replaced by stringtoreplacewith.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBREPL example</title>
</head>
<body>
Original text: The rain in Spain stays mainly in plains.<br>
Changed text: $WBREPL[The rain in Spain stays mainly in plains.|Spain|France]
</body>
</html>

After running this example, the resulting page in browser, may look like this:

Original text: The rain in Spain stays mainly in plains.
Changed text: The rain in France stays mainly in plains.