$WBMREPL - multi replace string

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

Syntax
$WBMREPL{sourcetext|arrayofstringstobereplaced|arrayofstringstoreplacewith|separator|casesensitive}
$WBMREPL[sourcetext|arrayofstringstobereplaced|arrayofstringstoreplacewith|separator|casesensitive]

Parameters
sourcetext - text on which to perform the replacement
arrayofstringstobereplaced - an array of text elements to be searched for inside sourcetext, separated by separator. It mush have same number of elements as arrayofstringstoreplacewith
arrayofstringstoreplacewith - an array of text elements to replace for every successful match of equivalent element of arrayofstringstobereplaced in sourcetext. It mush have same number of elements as arrayofstringstobereplaced
separator - optional parameter that defines the separator character used to separate elements of two array parameters. If omitted, a comma character (,) is used
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 every element of arrayofstringstobereplaced replaced by equivalent element of arrayofstringstoreplacewith.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
<title>WBMREPL example</title>
</head>
<body>
Original text: The rain in Spain stays mainly in plains.<br>
Changed text: $WBMREPL[The rain in Spain stays mainly in plains.|Spain,in plains,rain|France,on mountains,snow]<br>
Example of changing decimal symbol and digit grouping character:<br>
Original number: 1,451,345.67<br>
Changed number: $wbmrepl[1,451,345.67|,-.-;|;-,-.|-]
</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 snow in France stays mainly on mountains.
Example of changing decimal symbol and digit grouping character:
Original number: 1,451,345.67
Changed number: 1.451.345,67

Please note that in second example (changing decimal symbol and digit grouping character) we had to change the separator character to dash (-). You can also see that elements are replaced by their order in the array. So, WhizBase first replaced all commas (,) with semicolon (;). Then it replaced the full stop character (.) with comma (,), and finally replaced semicolons (;) with full stop characters (.)