String comparison question

Olivier Langlois olanglois at quazal.com
Mon Mar 20 14:46:35 EST 2006


Hi Michael,

Normalizing the whitespace is what I was looking to do. I guess that
that aspect of my original query was not enough clear. But with either
solutions, I get the result I wanted.

Greetings,
Olivier Langlois
http://www.quazal.com
 
> -----Original Message-----
> Fredrik Lundh wrote:
> 
> >
> >>>> " hello world ".split()
> > ['hello', 'world']
> 
> a.split() == b.split() is a convenient test, provided you want to
> normalize
> whitespace rather than ignore it.  I took the OP's requirements to
mean
> that
> 'A   B' == 'AB', but this is just a guess.
> 
> 
> Michael



More information about the Python-list mailing list