How can I relpace in a list like this a Symbol
by {}
:
{x$1273, 14, x$1275}, {25, 33}, {x$1274}}
I would like to get:
{{}, 14, {}}, {25, 33}, {{}}}
How can I relpace in a list like this a Symbol
by {}
:
{x$1273, 14, x$1275}, {25, 33}, {x$1274}}
I would like to get:
{{}, 14, {}}, {25, 33}, {{}}}
Use Replace
with level spec {-1}
:
Replace[{{x$1273, 14, x$1275}, {25, 33}, {x$1274}}, _Symbol -> {}, {-1}]
{{{}, 14, {}}, {25, 33}, {{}}}
If you don't want to worry about levels, you can use
{{x$1273, 14, x$1275}, {25, 33}, {x$1274}}/. Except[List, _Symbol] -> {}
{{{}, 14, {}}, {25, 33}, {{}}}