StrReplace
Use this function to replace a part of a character string with a different character string.
You may find the StrReplace function useful for comparison purposes. For example, suppose a complete symbol in your system appears in the format A11234. You can use the StrReplace function to change all prefix codes from A to B.
Syntax:
STRREPLACE ("String","SearchString","NewString")
where:
- String is a character string, enclosed in double quotation marks.
-
SearchString is an existing character string.
- Enclose in double quotation marks.
- This parameter is case-sensitive and must be typed with the correct combination of uppercase and lowercase letters.
-
NewString is a new character string.
- Enclose in double quotation marks.
- This parameter is case-sensitive and must be typed with the correct combination of uppercase and lowercase letters.
Syntax example:
STRREPLACE (CodeLetB,"A","B")
Code example:
CREATE VARIABLE StrTemp1 AS STRINGVariable = STRREPLACE ("SourceString","SearchFor","ReplaceWith")SET VARIABLE StrTemp1 = STRREPLACE ("StringTest","Test","xxxx")
// StrTemp1 will equal "Stringxxxx" (without the double quotation marks)