replace a particlaut string in a string python code example
Example 1: python replace substring
txt = "I like bananas"
x = txt.replace("bananas", "apples")
print(x) # ----> I like apples
Example 2: python replace string
string.replace(old, new, count)