I am really new in this patterns part of Mathematica. Basically what I need to do is eliminate null elements from a list but that has a specific name before the empty element. For example, my list is:
list={"a11-b11-{}", "a12-b11-{1}", "c11-d22-{}", "d33-c22-{2}"}
and I need to obtain
list={"a12-b11-{1}", "d33-c22-{2}"}
The list was created using
list = Flatten[Table[ ToString[namea[[i]] <> "-" <> nameb[[j]] <> "-" <>
ToString[ Select[int[i, j, 0.5], Abs[#] == 0.5 &, 1] ]],
{i, 1, 4}, {j, 1, 4}], 1]
and for some values it writtes {}
because there is not a value equal to $0.5$. Until now I have been able to do it term by term as
list//."a11-b11-{}"-> Sequence[]
but the real list contains a lot of elements and could be almost impossible to do it that way to solve the problem. I think my main problem is that I am not sure how to specify the pattern search (something like " *-name " in gnu/linux). Is there a wise way to do this?. Thanks in advance.
DeleteCases
andStringMatchQ
orStringContainsQ
. $\endgroup$int
function, and then construct strings only from the remaining ones. $\endgroup$