Replaces characters in the value contained in the source attribute based on the replacement key-value pairs.The replacement pairs parameter is a list of
key value key value ... .
Each instance of a key in the source string will be replaced with its corresponding value. If case-sensitive is no, then matching is done without regard to case differences. Both the keys and values may have multiple characters. Replacement is done in an ordered manner, so the key appearing first in the list will be checked first, and so on.
For example, if the source attribute’s value was:
bobby
and the replacement pairs were:
b s o a
the result will contain:
sassy
Note that the replacement pairs are separated by spaces. If either of the strings contains a space, it must be escaped with a \. For example, if the source attribute’s value was:
billy bob
and the replacement pairs were:
y\ b a
the result will contain:
billaob
If either of the strings contains a backslash \
, it must be escaped with a backslash \
. A single backslash not followed by a space will be ignored. For example, if the source attribute’s value was:
\billybob
And the replacement pairs were:
\\b a
The result will be:
aillybob
To substitute a substring specified using regular expressions, use the StringReplacer transformer.
Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.
Search for samples and information about this transformer on FMEpedia.
Keywords: StringPairedReplacer