Services & Resources / Wolfram Forums / MathGroup Archive
-----

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: [mg82344] Re: [mg82267] Finds strings in a list that begin with "A"
  • From: Fred Meinberg <fredm at wolfram.com>
  • Date: Thu, 18 Oct 2007 04:49:31 -0400 (EDT)
  • References: <200710170744.DAA13490@smc.vnet.net>

You can use

Select[list, StringMatchQ[#, "A*"]&]

and set IgnoreCase -> True inside StringMatchQ if you want to include  
strings beginning with "a".

Fred Meinberg
Wolfram Research

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
>



  • Prev by Date: Re: Releasing several Holds simultaneously
  • Next by Date: Re: Font problem in Mathematica 6.0.1 Linux
  • Previous by thread: RE: Finds strings in a list that begin with "A"
  • Next by thread: Re: Finds strings in a list that begin with "A"