4.32 STRSUB

Use STRSUB to substitute one string within another string field or constant.

Syntax

@STRSUB (source_string_or_col, search_string, substitute_string, ...)
source_string_or_col

The string or column to replace.

search_string

The value to be replaced.

substitute_string

The replacement value.

Examples

Example 1   

For this example, the source string is "123ABC123". The value "123" is to be replaced with "xx". The result is xxABCxx.

result = @STRSUB ("123ABC123", "123", "xx")
Example 2   

For this example, the source string is "123ABC123". The value "A" is to be replaced with "z" and the value "1" is replaced with "0". The result is 023zBC023.

result = @STRSUB ("123ABC123", "A", "z", "1", "0")