String comparison question

luc.saffre at gmail.com luc.saffre at gmail.com
Mon Mar 20 13:46:30 CET 2006


Michael Spencer wrote:
> Olivier Langlois wrote:
>
> > I would like to make a string comparison that would return true without
> > regards of the number of spaces and new lines chars between the words
> >
> > like 'A   B\nC' = 'A\nB    C'

Here is how I do such comparisons:

  if a.strip().split() == b.strip().split()

Luc




More information about the Python-list mailing list