Skip to main content

Timeline for The correct pattern for Cases

Current License: CC BY-SA 3.0

3 events
when toggle format what by license comment
Aug 28, 2014 at 6:07 comment added Mr.Wizard @Algohi It does work on that list but it doesn't remove the new expression {{}} that is created. That is a different interpretation from what I intended. If you with to remove that you could use //. but be aware that it is inefficient. For greater efficiency one might use: Replace[list, {({} | _Sequence) ..} -> Sequence[], {1, -1}]
Aug 28, 2014 at 4:30 comment added Basheer Algohi I don't think it will work for all levels. check this: {{{1, 2}, {3}, {4, 5, {5}}}, {{6}, {}, {}}, {{}, {{}, {}}}, {{}, {}, {2}}};
Aug 28, 2014 at 2:44 history answered Mr.Wizard CC BY-SA 3.0