Re: extracting elements from a list?
- To: mathgroup at smc.vnet.net
- Subject: [mg25407] Re: extracting elements from a list?
- From: "Martin Rommel" <Martin_Rommel at mac.com>
- Date: Fri, 29 Sep 2000 01:06:55 -0400 (EDT)
- References: <8qlon6$q8a@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
> 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