Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cases

  • To: mathgroup at
  • Subject: [mg50454] Re: [mg50423] Cases
  • From: "David Park" <djmp at>
  • Date: Sat, 4 Sep 2004 01:43:37 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


x = {a, b, c, d, d};

Not[d] // FullForm

I don't see any of those in the list.

Cases[x, a_ /; a =!= d]
{a, b, c}

This method might be easier.

{a, 0, b, 0, d} == {x, 0, y, 0, z} // Thread
% /. True -> Sequence[]

{a == x, True, b == y, True, d == z}
{a == x, b == y, d == z}

David Park
djmp at 

From: Blimbaum, Jerry AA R22 [mailto:jerry.blimbaum at]
To: mathgroup at

Given:   x = {a,b,c,d,d};

Applying   Cases[x,d]   gives an output of {a,b,c}......

However, Cases[x,Not[d]] gives as output an empty list  { }... I
expected   {a,b,c}.....

Why didnt I get that?

This issue came up when using Thread on vectors...and in some cases the
Thread resulted in 0 == 0  so it's output in the list  was 
True....and I
wanted to remove them....

thanks.....jerry blimbaum

  • Prev by Date: Re: ExpandAll Problem with Rules
  • Next by Date: Re: definite and indefinite Integrate
  • Previous by thread: Re: Cases
  • Next by thread: Re: Cases