#N canvas 516 78 561 623 10;
#X obj 2 375 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 472 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 2 526 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 78 384 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 481 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 78 406 cnv 17 3 60 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 2 615 cnv 1 550 1 empty empty empty 0 0 0 4 #fcfcfc #fcfcfc 0;
#X obj 2 594 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 303 268 print unchanged;
#X text 134 385 anything;
#X text 134 436 anything;
#X text 134 481 anything;
#X obj 78 502 cnv 17 3 17 empty empty 1 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 134 502 anything;
#X text 98 406 set <anything>;
#X text 92 535 1) float/symbol;
#X text 92 552 2) float/symbol;
#X text 192 501 - the input message if no substitution occurred;
#X msg 312 198 set 5 10;
#X msg 287 150 this that;
#X obj 138 237 cyclone/substitute that this;
#X obj 138 267 print substituted;
#X text 92 570 3) float/symbol;
#X text 52 91 [substitute] exchanges an element (the first argument) in an input message to another one (second argument).;
#X text 190 385 - any message to have elements substituted or not;
#X text 192 481 - the substituted message if a substitution occurred;
#X text 192 535 - the match element that should be replaced (default 0);
#X text 192 552 - the replacement for the match (default 0);
#N canvas 761 94 470 284 first_only 0;
#X text 80 19 [substitute] will replace all recurring elements in a message \, but if you have a 3rd argument \, it operates in "first only" mode \, where only the first element is replaced., f 53;
#X obj 248 134 cyclone/substitute foo bar 1;
#X obj 64 134 cyclone/substitute foo bar;
#X obj 64 192 cyclone/prepend set;
#X obj 248 191 cyclone/prepend set;
#X msg 248 227 bang;
#X msg 64 227 bang;
#X msg 248 90 foo 1 foo 2 foo 3;
#X obj 258 162 loadbang;
#X connect 1 0 4 0;
#X connect 2 0 3 0;
#X connect 3 0 6 0;
#X connect 4 0 5 0;
#X connect 7 0 1 0;
#X connect 7 0 2 0;
#X connect 8 0 4 0;
#X connect 8 0 3 0;
#X restore 452 245 pd first_only \; mode;
#X msg 138 168 1 2 3 4 5;
#X msg 115 145 5 5 5 4 4 4;
#X msg 303 174 4 5;
#X text 192 570 - any float or symbol sets susbtitute to "first only" mode;
#X text 190 406 -;
#X text 202 406 set followed by 2 items sets the 1st element to be substituted by the 2nd (other elements are ignored);
#X text 190 436 -;
#X text 202 437 sets the 1st element to be substituted by the 2nd \, other elements are ignored (basically the same as "set");
#X msg 158 197 this and that;
#X obj 4 5 ./header substitute;
#X text 22 63 Substitute elements in messages;
#X text 69 325 see also:;
#X obj 409 341 open-else;
#X text 461 312 click;
#X msg 409 313 replace;
#X text 135 319 Plugdata users or those with ELSE can also use [else/replace] as an alternative., f 43;
#X connect 18 0 20 1;
#X connect 19 0 20 1;
#X connect 20 0 21 0;
#X connect 20 1 8 0;
#X connect 29 0 20 0;
#X connect 30 0 20 0;
#X connect 31 0 20 1;
#X connect 37 0 20 0;
#X connect 43 0 41 0;
