[Tutor] How to strip both single and double quotes

Alan Gauld alan.gauld at freenet.co.uk
Wed Oct 5 13:38:53 CEST 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('\'"')

HTH,

Alan G
Author of the learn to program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list