string.join question

Erik Max Francis max at alcyone.com
Wed Oct 2 21:02:25 EDT 2002


mongo57a at comcast.net wrote:

> Trying to join a string as follows: string.join(['\,'aaa','\],'')
> (the last characters are 2 single quotes).
> I want a character string which looks like 'aaa' (with quotes).
> Anybody know
> what I'm doing wrong? or if this is possible with string.join?

If I understand you correctly (which I'm not sure that I do), try
something like

	string.join(["'", 'aaa', "'"], '')

If you insist on using single quotes, you can use '\'' instead of "'".

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Love is the selfishness of two persons.
\__/ Antoine de la Salle
    Maths reference / http://www.alcyone.com/max/reference/maths/
 A mathematics reference.



More information about the Python-list mailing list