You are looking at many info about swaps

Swap

Use swap to change text within a string variable.
Swap has 2 ways of working on a string:

Syntax 1: swap $variable add|take {string} [by {delimiter}];
Syntax 2: swap $variable so {oldstring} is {newstring};

{string} in this context is iether a string with or without quotes or a $variable that contains a string eg $actor's colour;

x is a delimiter character (or characters) and the default is a pipe or vertical bar |

If your added string contain iether a comma or your designated delimiter then you will be inserting multiple entities.

When doing the manipulations, all delimiters are converted to commas for simplicity then reverted back to your designated or default delimiter.

Using the first variety with iether 'add' or 'take' the string from the variable.

eg:

$rrr = "_roaming_";
$mat = "_living_|_roaming_|_dancing_";
swap $mat add _sleeping_;
swap $mat add _living_;
swap $mat take $rrr;
rem $mat will be '_dancing_|_sleeping_|_living_';


Using swap to replace one string with another, is not as complicated and pays no attention to delimiters:

$mat = "we talk about talking";
swap $mat so "talk" is "sing";
rem $mat will be 'we sing about singing";



read the info about material manipulation
read the info about value of