Complete string replace test macro:
{
"Name": "replace2",
"CreationDate": "2023-5-11",
"Commands": [
{
"Command": "store",
"Target": "3 months \\n5 months \\none year",
"Value": "a",
"Description": ""
},
{
"Command": "echo",
"Target": "a=${a}",
"Value": "blue",
"Description": ""
},
{
"Command": "executeScript_Sandbox",
"Target": "return ${a}.replace(/( |\\n|\\r)/gm, \"\")",
"Value": "i",
"Description": "replace space and cr"
},
{
"Command": "echo",
"Target": "i=${i}",
"Value": "green",
"Description": ""
}
]
}
See also: string handling