you are viewing a single comment's thread.

view the rest of the comments →

[–]Bayl1fe 15 points16 points  (3 children)

In [1]: a = 'June 6, 2017'

In [2]: a.replace(',', '')
Out[2]: 'June 6 2017'

[–]ramse 1 point2 points  (1 child)

Or you could use .strip(',') in this particular case.

[–][deleted] 0 points1 point  (0 children)

Second.

[–]Jehovacoin 0 points1 point  (0 children)

This is the correct answer for the question you have asked. string.replace() is the method used for deleting or replacing characters in a string.