@ReplaceAll

@REPLACEALL replaces the part of a string that contains the expression with a replacement string.

DTP Type:

@REPLACEALL cab be assigned to a DTP of type string, password, member, members, dimension, or dimensions.

Syntax:

@REPLACEALL(String,Regular Expression,replaceString)

Parameters:

Parameter Description
String Design-time prompt or text
Regular Expression Design-time prompt or text
replaceString Design-time prompt or text

Example:

[ReplaceAll_Str]=@REPLACEALL([String1],[Rep_String],[new_String])

Where:

  • [ReplaceAll_Str] is a a DPT of type string that is not a checked prompt.

  • [String1] is a DTP of type string that is a checked prompt.

  • [Rep_String] is a DTP of type string that is a checked prompt.

  • [new_String] is a DTP of type string that is a checked prompt.

Assume that the parameters are as follows:

  • String: "This is a test of a testing string"

  • Regular Expression: "Test"

  • Replace String "XYZ"

In this example, [ReplaceAll_Str] returns: "This is a XYZ of a XYZing string for one XYZ and two XYZ". It replaced with "test with XYZ. "