Answers for "python replace everything after commas"

0

replace commas with spaces python

commas_string = "Hello,World,foo,bar"
spaces_string = comma_string.replace(',', ' ')

print(spaces_string)
# Hello World foo bar
Posted by: Guest on June-22-2021
0

open file find and replace commas python

with open('outputFile', 'r+') as f:
    text = f.read()
    f.seek(0)
    f.truncate()
    f.write(text.replace('(comma)', ' , '))
Posted by: Guest on June-03-2021

Code answers related to "python replace everything after commas"

Python Answers by Framework

Browse Popular Code Answers by Language