MathGroup Archive 2007

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

Search the Archive

RE: Finds strings in a list that begin with "A"

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82340] RE: [mg82267] Finds strings in a list that begin with "A"
  • From: "David Annetts" <davidannetts at aapt.net.au>
  • Date: Thu, 18 Oct 2007 04:47:27 -0400 (EDT)
  • References: <200710170744.DAA13490@smc.vnet.net>

Hi Tom,

> 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 ?

One way is 

	Select[lst, (StringTake[#, 1] == "A") &]

Regards,

Dave.



  • Prev by Date: Re: Finds strings in a list that begin with "A"
  • Next by Date: Re: Finds strings in a list that begin with "A"
  • Previous by thread: Finds strings in a list that begin with "A"
  • Next by thread: Re: Finds strings in a list that begin with "A"