MathGroup Archive 2004

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

Search the Archive

Re: how to delete duplicate items in the same list


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

If a sorted result is acceptable just use Union

Union[orig]

{a,b,c,d}

To maintain order using the first occurrence

Fold[If[MemberQ[#1, #2], #1, Append[#1,#2]]&,{},orig]

{b,c,a,d}


Bob Hanlon

In article <bto1uf$2ka$1 at smc.vnet.net>, Sabrina <hxs61 at case.edu> wrote:

<< I can't find a way to make sure all items in the same list are unique. Can
anybody help me out? Thanks a lot!


  • Prev by Date: RE: how to delete duplicate items in the same list
  • Next by Date: Re: Graphics / cosmetics
  • Previous by thread: RE: how to delete duplicate items in the same list
  • Next by thread: Re: how to delete duplicate items in the same list