STR REPLCE - Replace a sub-string of a string with another sub-string (Reports & Settings Report Generator function)

From Catalyst
Revision as of 09:43, 21 April 2011 by ThrashBot (talk | contribs) (Updated from revision control)
Jump to: navigation, search

Syntax

$STR_REPLCE{string, search-sub-string, replace-sub-string, Count}

Description

Replace a sub-string of a string with another sub-string.


Parameters

string
A text parameter that can not be omitted.
The string that contains the sub-string.
search-sub-string
A text parameter that can not be omitted.
The sub-string, that will be searched for in the string.
replace-sub-string
A text parameter that can be omitted.
The substring, that will replace the Search sub-string in the main string. This defaults to nothing, the effect being that the Search sub-string will simply be removed.
Count
A text parameter that can be omitted (it defaults to "0").
The occurence of the Search sub-string to replace
0
Will replace all occurences of the Search sub-string.
1
Will replace the first occurence of the Search sub-string.
2
Will replace the second occurence of the Search sub-string.
-1
Will replace the last occurence of the Search sub-string.
-2
Will replace the penultimate occurence of the Search sub-string.

Returns

A text value. The string with the replacement(s).