replace
The replace
NSM predefined function replaces
the first occurrence of the search string in the target string with
the replacement string. The process of replacement is case sensitive.
Syntax
replace(target,search,replacement)
Parameters
- target
- Specifies the target string.
- search
- Specifies the string for which to search.
- replacement
- Specifies the replacement string.
Description
The replace
NSM
predefined function replaces the first occurrence of the search string
specified in search in the target string specified
in target with the replacement string specified
in replacement.
Returns
This function returns a string that is derived from replacing the first occurrence of the search string specified in search in the target string specified in target with the replacement string specified in replacement.
Examples
replace("10.2.3.10", "10", "4") returns "4.2.3.10" replace("100.1.1.23", "1", "5") returns "500.1.1.23" replace("ge10 GE10 ge10","GE10","") returns "ge10 ge10"replace("1234", "", "1") ERROR is thrown here replace("", "3", "8") /* ERROR is thrown here*/