FindAndRemove — Find elements matching target and remove them from the list.
List like the original list except with the find value removed from it.
ListVariable | List to find and remove from. Can be either a value or @VarName (will upvar and read/write). |
FindValue | What to find and remove from list. |
Note that arguments of the form XxxVariable can take either a normal value or the name of a variable to read/write, prefixed by @. See
About Using @ for details.
For information regarding exceptions / errors, see
here.
% set MyList {one two three}
one two three
% FindAndRemove $MyList two
one three
% set MyList {one two three}
one two three
% FindAndRemove @MyList two
one three
% puts $MyList
one three