Difference between revisions of "STR REPLCE - Replace a sub-string of a string with another sub-string (Reports & Settings Report Generator function)"
From Catalyst
(Updated from revision control) |
(Updated from revision control) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
== Syntax == | == Syntax == | ||
− | '''$STR_REPLCE'''{string, search | + | '''$STR_REPLCE'''{string, search, replace, count} |
== Description == | == Description == | ||
Line 13: | Line 13: | ||
:A text parameter that can not be omitted. | :A text parameter that can not be omitted. | ||
:The string that contains the sub-string. | :The string that contains the sub-string. | ||
− | ;search | + | ;search |
:A text parameter that can not be omitted. | :A text parameter that can not be omitted. | ||
:The sub-string, that will be searched for in the string. | :The sub-string, that will be searched for in the string. | ||
− | ;replace | + | ;replace |
:A text parameter that can be omitted. | :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. | :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 | + | :A numeric parameter that can be omitted (it defaults to "0"). |
− | :The | + | :The occurrence of the Search sub-string to replace |
:;0 | :;0 | ||
− | ::Will replace all | + | ::Will replace all occurrences of the Search sub-string. |
:;1 | :;1 | ||
− | ::Will replace the first | + | ::Will replace the first occurrence of the Search sub-string. |
:;2 | :;2 | ||
− | ::Will replace the second | + | ::Will replace the second occurrence of the Search sub-string. |
:;-1 | :;-1 | ||
− | ::Will replace the last | + | ::Will replace the last occurrence of the Search sub-string. |
:;-2 | :;-2 | ||
− | ::Will replace the penultimate | + | ::Will replace the penultimate occurrence of the Search sub-string. |
== Returns == | == Returns == | ||
Line 38: | Line 38: | ||
− | [[Category:Reports & | + | [[Category:Reports & Settings Report Generator functions]] |
Latest revision as of 13:05, 22 September 2016
Syntax
$STR_REPLCE{string, search, replace, count}
Description
Replace a sub-string of a string with another sub-string.
You may enclose any of the string or substring parameters between "[" and "]" to include leading or trailing spaces.
Parameters
- string
- A text parameter that can not be omitted.
- The string that contains the sub-string.
- search
- A text parameter that can not be omitted.
- The sub-string, that will be searched for in the string.
- replace
- 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 numeric parameter that can be omitted (it defaults to "0").
- The occurrence of the Search sub-string to replace
- 0
- Will replace all occurrences of the Search sub-string.
- 1
- Will replace the first occurrence of the Search sub-string.
- 2
- Will replace the second occurrence of the Search sub-string.
- -1
- Will replace the last occurrence of the Search sub-string.
- -2
- Will replace the penultimate occurrence of the Search sub-string.
Returns
A text value. The string with the replacement(s).