Substitute

Mon 01 January 2018

Syntax

Substitute(source_text, old_text, new_text)

Description

Use the Substitute function to replace every occurrence of a substring found in a string with a new substring. To replace text that occurs in a specific location in a text string use the Replace function.

Parameters

Field or Control

Definition

source_text

A String in which you want to replace substrings.

old_text

A String equal to the substring of source_text you want to replace.

A tilde character ( ~ ) used in the old_text parameter stands for an arbitrary number of white spaces. For example, the following substitution: Substitute("2003* 0723* * * * ~", "* ~", "~") produces the result 2003~0723~~~~~ , not the result 2003* 0723* * * ~ .

new_text

A String with which to replace occurrences of old_text in source_text .

Returns

Returns a String resulting from replacing every occurrence of old_text found in source_text with new_text .