SubstituteExcluded

STD.Str.SubstituteExcluded( source, target, replacement )

STD.Uni.SubstituteExcluded( source, target, replacement )

sourceA string containing the data to search.
target A string containing the characters to search for.
replacement A string containing the replacement character as its first character.
Return: SubstituteExcluded returns a STRING or UNICODE value, as appropriate.

The SubstituteExcluded functions return the source string with the replacement character substituted for all characters except those in the target string. If the target string is not in the source string, it returns the source string with all characters replaced by the replacement character.

Example:

IMPORT STD;
A := STD.Uni.SubstituteExcluded(u'abcdeabcdec', u'cd', u'x');
  //A contains u'xxcdxxxcdxc';