Page 1 of 1

Keyword: REPLACEVAR - Replace in text

Posted: Fri May 13, 2022 11:14 pm
by YiMeng
Description
  • Replace text within a string then returns replaced text as variable value.
  • Syntax and concept similar to "REMAP" except that it returns the replaced value as variable rather than perform as line command.

Parameters
  • x: The replace assignments.
    • Can be separated by the ":" colon symbol
    • Cannot include spaces
  • y: The text (haystack) to be used to search for any replacement to occur.

Usage
  • REPLACEVAR x y
  • REPLACEVAR 1=a 123
    • Will replace all occurrences of "1" to "a" then returns the string with replaced text to %REPLACEVAR%.
    • In this case, %REPLACEVAR% will return "a23".
    • ex: SETVAR myvar = %REPLACEVAR%