How to convert " " in a string to blank space?

wittempj@hotmail.com martin.witte at gmail.com
Mon Oct 30 12:33:23 EST 2006


Is this what you want?

py> s = 'This string contains   two times   - end'
py> print s.replace(' ', ' '*6)
This string contains        two times        - end


see http://docs.python.org/lib/string-methods.html

On Oct 30, 6:26 pm, "一首诗" <newpt... at gmail.com> wrote:
> Is there any simple way to solve this problem?




More information about the Python-list mailing list