Keyword: REPLACEVAR - Replace in text

Keywords are used within scripts that enabled powerful features such as dynamic variables, clipboard manipulation, read/write files, mimic inputs and more.
User avatar
YiMeng
Author
Posts: 235
Joined: Sat Jul 18, 2020 10:58 pm
Location: NY
Contact:

Keyword: REPLACEVAR - Replace in text

Unread post 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%