removes the symbols si completely, so that their names are no longer recognized by the Wolfram Language.
removes all symbols whose names textually match any of the arbitrary string patterns patti.
removes any symbols that are equal to or whose names match any of the speci.
- 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. »
- The pattern patt can be given as a string with metacharacters, as StringExpression[…] or as RegularExpression["regex"]. »
- Remove allows abbreviated string patterns containing 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["`*"] removes all symbols in the current context. »
- 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, PersistentSymbol and InitializationValue objects. »
- Remove does not affect symbols with the attributes Locked or Protected. »
- Remove has attribute HoldAll. »
Examplesopen allclose all
Symbol Inputs (2)
Using Patterns (5)
Remove all 2-character symbols in the current context using StringExpression:
Remove all 3-character symbols in the current context using RegularExpression:
Properties & Relations (5)
ClearAll also removes all properties and definitions but leaves the symbol intact:
Remove removes the symbol completely:
Possible Issues (3)
Use Unprotect to remove protected symbols:
Remove does not affected locked symbols:
When using a pattern without a context mark, all matching symbols on $ContextPath are removed:
Wolfram Research (1988), Remove, Wolfram Language function, https://reference.wolfram.com/language/ref/Remove.html (updated 2022).
Wolfram Language. 1988. "Remove." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/Remove.html.
Wolfram Language. (1988). Remove. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Remove.html