This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19
SUBSTITUTE
|
SUBSTITUTE ( str , toReplace , replacement {, instance} ) | ||||||||
Parameter | Type | Description | ||||||
str | CellRef |
![]() |
String or reference to a cell containing the string in which you want to replace characters | |||||
toReplace | Text |
![]() |
String to replace | |||||
replacement | Text |
![]() |
New string to use instead of existing string | |||||
instance | Number |
![]() |
Which occurrence of the existing string to replace; otherwise every occurrence is replaced | |||||
The SUBSTITUTE function replaces toReplace in the str text with replacement and returns the edited text.
By default, SUBSTITUTE replaces the first occurrence of toReplace. Pass instance to define which occurrence you want to replace.
If no occurrence of toReplace is found, SUBSTITUTE returns str.
SUBSTITUTE("Hello You","You","World") //Hello World
Product: 4D
Theme: 4D View Pro Formulas
4D View Pro Reference ( 4D v19)