Replace
String functions replace
syntax
- replace(source_string_dataitem, old_substring, new_substring)
definition
replace(source_string_dataitem, old_substring, new_substring) replaces old_substring in the source_string_dataitem with new_substring.
description
The replace function replaces full and substrings in source_string_dataitem. The Replace_value function replaces only string values that fully match.
The replace function is case sensitive.
Multiple replacements can be combined in the replace function with the syntax: replace(source_string_dataitem, old_substring1, new_substring1, old_substring2, new_substring2).
Replacements are executed according to their configuration sequence, so in the example first old_substring1 by new_substring1, then old_substring2 by new_substring2.
applies to
- data items source_string_dataitem, old_substring, new_substring with string value types
conditions
The Domain unit of all arguments must match or be Void (literals or parameters can be compared to data items of any domain unit).
example
attribute<string> replaceA (ADomain) := replace(A, 'Tes', 'Taar');
| A | replaceA |
|---|---|
| ‘Test’ | ‘Taart’ |
| ‘test’ | ‘test’ |
| ‘88hallo99’ | ‘88hallo99’ |
| ‘Test met Text’ | ‘Taart met Text’ |
| ‘Text met Test’ | ‘Text met Taart’ |
ADomain, nr of rows = 5