Replace

The Replace function is used to search a string for a substring, and replace that substring with a different string.

Syntax

variable = Replace ( source, pattern, replacement, start, count )

Remarks

source                  The string that will be parsed by this instruction.

pattern                  The portion of the string in the original string that will be replaced. Note that in most cases the pattern will be a literal string and, therefore, must be enclosed in quotes and preceded by a $.

replacement          The string that should be used to replace the pattern. Note that in most cases the replacement will be a literal string and, therefore, must be enclosed in quotes and preceded by a $.

start                      An integer that specifies where in the source to begin the operation. A 1 indicates the first character in the string.

count                    The number of occurrences of the pattern that should be replaced by the replacement. A count less than or equal to zero indicates that all occurrences beginning from the start position will be replaced.