SUBSTITUIR
Substitui ou remove uma substring dentro da string fornecida.
Sintaxe
REPLACE(STRING, SEARCH [, REPLACE])
Argumentos
STRING
Tipo: string
A string a ser pesquisada.
SEARCH
Tipo: string
A substring a ser pesquisada em STRING.
Se for uma string vazia, então REPLACE será inserido na frente de cada caractere e no final da STRING.
REPLACE
Tipo: string
Padrão: ''
(Opcional) A string usada para substituir todas as instâncias encontradas de SEARCH.
Se omitido, todas as instâncias de SEARCH são removidas de STRING.
Retorna
Tipo: string
Uma substring da entrada STRING.
Exemplos
| STRING | SEARCH | SUBSTITUIR | Saída |
|---|---|---|---|
| caractere | g | strin | |
| a | a | ''
|
|
| a | a | b | b |
| 123 | 1 | 23 | |
| word | word | bird | bird |
| word | bird | thing | word |
| word | ou | wd | |
| word | null
|
null
|
|
null
|
bird | null
|