MathGroup Archive 2000

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

Search the Archive

Re: extracting elements from a list?


> If i have the list {v$2332Period, v$2334Period, v$1231MaxAccel}
> How would i go about searching through this list and returning a new
> list that has only elements with the word "Period" in them.

I assume you the list consists of strings, otherwise wrap the ToString
command around the argument #.

Select[{"v$2332Period", "v$2334Period", "v$1231MaxAccel"},
  StringPosition[#, "Period"] != {} &]

Out[36]=
{"v$2332Period", "v$2334Period"}

Cheers, Martin




  • Prev by Date: extracting common items from a list
  • Next by Date: Re: Point inside a polygon?
  • Previous by thread: Re: extracting elements from a list?
  • Next by thread: Re: extracting elements from a list?