Alan Gauld wrote at 04:38 10/5/2005:
> > how to use strip just once to get rid of both kinds of quotes, single
> and
> > double. It seems necessary to do it something like this:
>
>JUst escape the quote character:
>
>s.strip('\'"')
That did it!
Thanks,
Dick Moores
_
On 10/5/05, Dick Moores <[EMAIL PROTECTED]> wrote:
> The text will contain "words" beginning or ending with non-alphabetic
> characters. To strip them off I use string.strip([chars]). My question is
> how to use strip just once to get rid of both kinds of quotes, single and
> double. It seems neces
> how to use strip just once to get rid of both kinds of quotes, single and
> double. It seems necessary to do it something like this:
JUst escape the quote character:
s.strip('\'"')
HTH,
Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld
I'm writing a script that takes any text and outputs to a file a list of
duples (k, word) where k is the number of occurrences of word in the text.
The text will contain "words" beginning or ending with non-alphabetic
characters. To strip them off I use string.strip([chars]). My question is
how