Re: Position
- To: mathgroup at smc.vnet.net
- Subject: [mg67676] Re: [mg67639] Position
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Tue, 4 Jul 2006 01:57:48 -0400 (EDT)
- Reply-to: hanlonr at cox.net
- Sender: owner-wri-mathgroup at wolfram.com
Take a look at the command StringPosition Bob Hanlon ---- Bruce Colletti <vze269bv at verizon.net> wrote: > Let X be a list of strings having diverse lengths (some are the null string ""). > > What command returns the position in X of the first element that starts with "abcd"? > > Presumably the command looks like Position[X,...,Heads->False], but my attempts have come up dry. Although StringTake[Y,4]=="abcd" would seem to be part of the command, this fails when the string's length is less than 4. > > Thankx. > > Bruce