substitute

Searches for a pattern in a string or in the string elements of an array and substitutes the first occurrence of "pattern_string" with "replacement_string".

Syntax

substitute ( pattern_string, replacement_string, 
string_expression|array_expression )

Example 1

#sq ( substitute ( '^cn=', '***', 'cn=help' ) )#

Result

'***help'

Example 2

# csv ( substitute ( '^cn=', '***', array ( 'cn=help' , 'acn=5' ) ) ) 
#

Result

'***help', 'acn=5'

Example 3

# csv ( substitute ( 'cn=', '', array ( 'cn=help' , 'acn=5' ) ) ) #

Result

'help', 'a5'