Re: Finding the Position of Elements in a List that Contain
- To: mathgroup at smc.vnet.net
- Subject: [mg102235] Re: [mg102157] Finding the Position of Elements in a List that Contain
- From: Gregory Lypny <gregory.lypny at videotron.ca>
- Date: Sun, 2 Aug 2009 05:58:54 -0400 (EDT)
- References: <20090731232907.NREXA.9319.imail@eastrmwml48>
Ahhh, thank you, Bob! Elegant. Just pull out the first dimension of each element of StringPosition. Gregory On Fri, Jul 31, 2009, at 11:29 PM, Bob Hanlon wrote: > listOfStrings = {"The cat is here.", "It's not here.", > "Not in the catalogue,", "Where is the cat?"}; > > First /@ Position[ > StringPosition[listOfStrings, "cat"], {_, _}] > > {1,3,4}