String Handling

Richard Gruet rgruet at ina.fr
Tue Jan 4 09:36:40 EST 2000


try this :

import string
s = string.join(string.split('Lucy by Railway Carraige'), '+')

Richard

Simon Faulkner wrote:

> Hi All,
>
> Can anyone give me the Python line/command to change all spaces in a
> string to +s?
>
> ie
>
> "Lucy by Railway Carraige"
>
> becomes
>
> "Lucy+by+Railway+Carraige"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20000104/2fd8e324/attachment.html>


More information about the Python-list mailing list