MathGroup Archive 2005

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

Search the Archive

Re: removing subelements


borges2003xx at yahoo.it wrote:

> i'm a newbie. How implement the _faster functon_ which removes in a
> list every element that are a subelement.
> which means
> f[x]:=  {..,{1,2,3,4},..,{2,3},..} removes {2,3}.

I'm not exactly sure what you're after but Complement[...] may do the trick:

In[1]:= Complement[{1,2,3,4}, {2,3}]
Out[1]= {1, 4}

-- 
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com


  • Prev by Date: sparse matrix question
  • Next by Date: Re: Can you type a command and have Mathematica show the parameters?
  • Previous by thread: Re: Re: FortranForm o/p question
  • Next by thread: Re: removing subelements