programming-examples/python/Regular_Expression/Replace whitespaces with an underscore and vice versa.py
2019-11-15 12:59:38 +01:00

6 lines
136 B
Python

import re
text = 'Python Exercises'
text =text.replace (" ", "_")
print(text)
text =text.replace ("_", " ")
print(text)