MathGroup Archive 2006

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

Search the Archive

Re: finding the position of a pattern in list


In[25]:=
findPos[x_List]:=
    StringPosition[ToString/@x//StringJoin,
        "0"~~"1"]/.{a_Integer,_}:>a;
In[26]:=
findPos[{0,0,1,1,1,0,0,1,1,1,0}]
Out[26]=
{2,7}

dkr


  • Prev by Date: Re: finding the position of a pattern in list
  • Next by Date: Plot -> axes inversion
  • Previous by thread: Re: finding the position of a pattern in list
  • Next by thread: Re: finding the position of a pattern in list