Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python String Replace method

string = "Welcome to Softhunt website, Softhunt is a website dedicated to programming courses"

print("Original String: ", string)
# replacing s by e
print("Replaced String: ", string.replace("s", "e"))

# 3 occurrence of m by a
print("Replaced with 3 occurrences: ", string.replace("m", "a", 3))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Python #String #Replace #method
ADD COMMENT
Topic
Name
9+5 =