@repl() Function |
![]() ![]() ![]() |
@repl() function replaces substrings in a string with another substring and returns the result. Syntax: @repl(source-expression, search-for-expressions, replace-with-expressions)
source-expression The string expression in which search-for-expressions to be replaced with replace-with-expressions. search-for-expressions The sub-strings to be searched within the source-expression. It can be a single expression or an array of expressions enclosed with "[" and "]" characters and delimited with commas. replace-with-expressions The sub-strings to replace the found sub-strings within the the source-expression. It can be a single expression or an array of expressions enclosed with "[" and "]" characters and delimited with commas. @repl('--a--b--c--c--b--a--','-b-','*b*')
@// returns:'--a-*b*-c--c-*b*-a--'
@repl('<abc>','&','&')
@// returns:'<abc>'
@set(v:STR,'<aaa>R&D</aaa>') @repl(v:STR,['&','<','>'],['&','<','>'])
@// returns: '<aaa>R&D</aaa>' |