Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Jervis Whitley
> > I agree that it's an alternative. There are a number of alternatives. > However the OP was asking for a "neater/easier" alternative. I argue > that introducing an external module/function to do the exact same thing > as a built-in type's method doesn't exactly qualify as a "neater/easier" > alt

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Albert Hopkins
On Fri, 2009-03-20 at 08:52 +1100, Jervis Whitley wrote: > On Fri, Mar 20, 2009 at 8:28 AM, Albert Hopkins > wrote: > > On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote: > >> > > >> >if stringA.lower() in stringB.lower(): > >> >bla bla bla > >> > > >> > >> from string impor

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Jervis Whitley
On Fri, Mar 20, 2009 at 8:28 AM, Albert Hopkins wrote: > On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote: >> > >> >    if stringA.lower() in stringB.lower(): >> >        bla bla bla >> > >> >>     from string import lower >> >>     if lower(stringA) in lower(stringB): >>          # was thi

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Albert Hopkins
On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote: > > > >if stringA.lower() in stringB.lower(): > >bla bla bla > > > > from string import lower > > if lower(stringA) in lower(stringB): > # was this what you were after? > This is analogous to standing behind a

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Jervis Whitley
> >    if stringA.lower() in stringB.lower(): >        bla bla bla > from string import lower if lower(stringA) in lower(stringB): # was this what you were after? Cheers, Jervis -- http://mail.python.org/mailman/listinfo/python-list

Re: Neatest way to do a case insensitive "in"?

2009-03-19 Thread Steve Holden
aiwarrior wrote: > On Mar 13, 9:31 pm, Albert Hopkins wrote: >> On Fri, 2009-03-13 at 21:04 +, tinn...@isbd.co.uk wrote: >>> What's the neatest way to do the following in case insensitive fashion:- >>> if stringA in stringB: >>> bla bla bla >>> I know I can just do:- >>> if str

Re: Neatest way to do a case insensitive "in"?

2009-03-14 Thread Tino Wildenhain
tinn...@isbd.co.uk wrote: ... But I was wondering if there's a neater/easier way? How is "if stringA.lower() in stringB.lower():" complex/messy? Well I guess I was just looking for "incase" a bit like "strcasecmp" in C. Which locales case folding do you want to have applied? Tino smime.p

Re: Neatest way to do a case insensitive "in"?

2009-03-13 Thread MRAB
tinn...@isbd.co.uk wrote: What's the neatest way to do the following in case insensitive fashion:- if stringA in stringB: bla bla bla I know I can just do:- if stringA.lower() in stringB.lower(): bla bla bla But I was wondering if there's a neater/easier way? Not unl

Re: Neatest way to do a case insensitive "in"?

2009-03-13 Thread tinnews
Albert Hopkins wrote: > On Fri, 2009-03-13 at 21:04 +, tinn...@isbd.co.uk wrote: > > What's the neatest way to do the following in case insensitive fashion:- > > > > if stringA in stringB: > > bla bla bla > > > > I know I can just do:- > > > > if stringA.lower() in stringB.l

Re: Neatest way to do a case insensitive "in"?

2009-03-13 Thread aiwarrior
On Mar 13, 9:31 pm, Albert Hopkins wrote: > On Fri, 2009-03-13 at 21:04 +, tinn...@isbd.co.uk wrote: > > What's the neatest way to do the following in case insensitive fashion:- > > >     if stringA in stringB: > >         bla bla bla > > > I know I can just do:- > > >     if stringA.lower() i

Re: Neatest way to do a case insensitive "in"?

2009-03-13 Thread Albert Hopkins
On Fri, 2009-03-13 at 21:04 +, tinn...@isbd.co.uk wrote: > What's the neatest way to do the following in case insensitive fashion:- > > if stringA in stringB: > bla bla bla > > I know I can just do:- > > if stringA.lower() in stringB.lower(): > bla bla bla > > But I

Neatest way to do a case insensitive "in"?

2009-03-13 Thread tinnews
What's the neatest way to do the following in case insensitive fashion:- if stringA in stringB: bla bla bla I know I can just do:- if stringA.lower() in stringB.lower(): bla bla bla But I was wondering if there's a neater/easier way? -- Chris Green -- http://mail.pytho