Re: list splitting
- To: mathgroup at smc.vnet.net
- Subject: [mg4906] Re: [mg4872] list splitting
- From: Andrei Constantinescu <constant at athena.polytechnique.fr>
- Date: Fri, 4 Oct 1996 00:17:42 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Hi ! I think you can do the job using Position and MemberQ: In[1]:= l = {{{ 1, 2, {a-> 3, b-> 4, c-> 4}, 5}, {6, 7, {a-> 8, b-> 9}}} } Out[1]= {{{1, 2, {a -> 3, b -> 4, c -> 4}, 5}, {6, 7, {a -> 8, b -> 9}}}} In[5]:= MemberQ[ l , a -> 3 , 4 ] Out[5]= True In[6]:= MemberQ[ l , a -> 2 , 4 ] Out[6]= False In[7]:= Position[ l, a -> 3 ] Out[7]= {{1, 1, 3, 1}} Regards, a + andrei ==== [MESSAGE SEPARATOR] ====