Re: Finds strings in a list that begin with "A"
- To: mathgroup at smc.vnet.net
- Subject: [mg82356] Re: [mg82267] Finds strings in a list that begin with "A"
- From: János <janos.lobb at yale.edu>
- Date: Thu, 18 Oct 2007 04:55:39 -0400 (EDT)
- References: <200710170744.DAA13490@smc.vnet.net>
On Oct 17, 2007, at 3:44 AM, tomfabtastic at hotmail.com wrote: > 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 > As a newbie I would go with: In[2]:= Select[lst, StringTake[#1, 1] == "A" & ] Out[2]= {"And", "Artistic"} where lst is your list. J=E1nos ------------------------------------------------- People never lie so much as after a hunt, during a war or before an election - Otto von Bismarck -
- References:
- Finds strings in a list that begin with "A"
- From: tomfabtastic@hotmail.com
- Finds strings in a list that begin with "A"