replace

replace every matched substring/s by given replacement string and return result


Parameters

replace string :string :literal
        match :string :regex :block
        replacement :string :block

Returns

  • :string
  • or  :nothing

Examples

copy
replace "hello" "l" "x" ; => "hexxo"

copy
str: "hello" replace 'str "l" "x" ; str: "hexxo"

copy
replace "hello" ["h" "l"] "x" ; => "xexxo" replace "hello" ["h" "o"] ["x" "z"] ; => "xellz"

Related