This function searches the text a in b (which is interpreted as a comma separated token list). If a is found, it will be replaced by the value that is at the same position in c (also interpreted as comma separated token list). The function returns the replacement value.
If e is set to true, a search matches if a value in b is a subtext of a. If set to false, a and the value in b have to be equal. See examples.
If a is not found in b, value d will be returned.
Parameters
Parameter | Description |
|---|---|
a | Search value. |
b | Comma-separated list of values. |
c | Comma-separated list of replacement values. |
d | Default value if value a cannot be found. |
e | (optional) If set to true, a subtext search will performed, otherwise, the check is for equality. See examples. Default: false. |
f | (optional) Delimiter for both lists. Default: , |
Examples
Parameter a | Parameter b | Parameter c | Parameter d | Parameter e | Parameter f | Result |
|---|---|---|---|---|---|---|
D | D,A | Germany,Austria | Somewhere | Germany | ||
A | D,A | Germany,Austria | Somewhere | Austria | ||
I | D,A | Germany,Austria | Somewhere | Somewhere | ||
DE | D,A | Germany,Austria | Somewhere | Somewhere | ||
AT | D,A | Germany,Austria | Somewhere | Somewhere | ||
IT | D,A | Germany,Austria | Somewhere | Somewhere | ||
DE | D,A | Germany,Austria | Somewhere | true | Germany | |
AT | D,A | Germany,Austria | Somewhere | true | Austria | |
IT | D,A | Germany,Austria | Somewhere | true | Somewhere |