Replace (PQL)

Returns replaces instances of the search string found inside a provided string with a replacement string.

  • Returned Output: Text
  • Library: PQL \ Common \ String
  • Version: 2018.00.000
  • Compatibility:
    • Can be combined with and other PQL function throughout the application.
    • It CANNOT be used with MDX or VBA functions. But it can be used on MDX-based content in other parts of the application.

Syntax

Replace( <Text> , <Search Text> , <Replace Text> )

* Click on the function's arguments above for more details on the input values.

Comments
  • The input, search and replacement text strings can be any alphanumeric set of characters.
Different Function types
  • This function is like the Excel "substitute" function.

Examples

This example returns "axxle" from the input string "apple" by replacing "pp" with "xx"

Replace("apple","pp","xx")

This example returns "axpxple" from the input string "apple" by replacing "p" with "xp"

Replace("apple","p","xp")