Code: Select all
{
local a "Can-t-be-used-as-name-for-variable"
local b "-"
:while condition=[find $a $b] do={
:set $a ("$[:pick $a 0 ([find $a $b]) ]"."$[:pick $a ([find $a $b]+1) ([:len $a])]")}
:put "Result string: $a"
}
Result string ($a): Cantbeusedasnameforvariable
The :local variable $b contains the single unwanted character.
I needed that, to be able to store counters in a variable in :global with different names referring to their origin.
Code: Select all
:local envName ("varName".$a);
[:parse "global $envName $tempCount"];
Result Global (/system script environment)
name: varNameCantbeusedasnameforvariable value: 10
You can adapt this to other characters and if you want to remove multiple different characters you need to create multiple instances of this script. Or make an other while-do to filter a list of characters.