Remove

Remove[symbol1,]

removes symbols completely, so that their names are no longer recognized by the Wolfram Language.

Remove["form1","form2",]

removes all symbols whose names match any of the string patterns formi.

Details

  • You can use Remove to get rid of symbols that you do not need, and which may shadow symbols in contexts later on your context path.
  • Remove["form"] allows the following metacharacters:
  • *match zero or more characters
    @match one or more characters, but not uppercase letters
  • Remove["context`*"] removes all symbols in a particular context.
  • Remove is HoldAll.
  • Remove does not affect symbols with the attribute Protected.
  • Once you have removed a symbol, you will never be able to refer to it again, unless you recreate it.
  • If you have an expression that contains a symbol that you remove, the removed symbol will be printed as Removed["name"], where its name is given in a string.
  • Remove works with LocalSymbol, CloudSymbol, PersistentValue and InitializationValue objects.

Examples

open allclose all

Basic Examples  (1)

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input

Scope  (2)

Generalizations & Extensions  (2)

Applications  (1)

Properties & Relations  (3)

Possible Issues  (1)

See Also

Clear  ClearAll  Names

Tutorials

Introduced in 1988
(1.0)