format.replace ViewHelper <vhs:format.replace>

Replaces $substring in $content with $replacement.

Supports array as input substring/replacements and content.

When input substring/replacement is an array, both must be the same length and must contain only strings.

When input content is an array, the search/replace is done on every value in the input content array and the return value will be an array of equal size as the input content array but with all values search/replaced. All values in the input content array must be strings.

Arguments

content

DataType
string
Required
false
Description
Content in which to perform replacement. Array supported.

substring

DataType
string
Required
true
Description
Substring to replace. Array supported.

replacement

DataType
string
Required
false
Description
Replacement to insert. Array supported.

returnCount

DataType
boolean
Required
false
Description
If TRUE, returns the number of replacements that were performed instead of returning output string. See also v:count.substring.

caseSensitive

DataType
boolean
Default
true
Required
false
Description
If true, perform case-sensitive replacement