Re: Finds strings in a list that begin with "A"
- To: mathgroup at smc.vnet.net
- Subject: [mg82377] Re: Finds strings in a list that begin with "A"
- From: "Oskar Itzinger" <oskar at opec.org>
- Date: Thu, 18 Oct 2007 05:06:25 -0400 (EDT)
- References: <ff4egn$d6p$1@smc.vnet.net>
Not the most artistic but it seems do to the trick:
l={"And","Bat", "Artistic", "Cob"};
Map[First,Map[Select[#,#[[2]]&]&,MapThread[List,{l,Map[Equal["A",
#]&,Map[StringTake[#,1]&,l]]}],{0}]]
{And, Artistic}
<tomfabtastic at hotmail.com> wrote in message
news:ff4egn$d6p$1 at smc.vnet.net...
> Hello,
>
> I am trying to look through a list of strings and return all strings
> that start with an "A".
>
> For example, my list could be :
>
> {"And", "Bat", "Artistic", "Cob"} so I want to return {"And",
> "Artistic"}.
>
> Any ideas ?
>
> Thanks,
> Tom
>
>