Lad wrote:

> In a text I need to
> add a blank(space) after a comma but only if there was no blank(space)
> after the comman
> If there was a blank(space), no change is made.

>>> s = "alpha, beta,gamma,  delta"
>>> ", ".join(t.replace(",", ", ") for t in s.split(", "))
'alpha, beta, gamma,  delta'

Peter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to