Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python replace matching string

s = 'one two one two one'

# 1st argument: string to find
# 2nd argument: string to put in place

print(s.replace(' ', '-')) # one-two-one-two-one
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #python #replace #matching #string
ADD COMMENT
Topic
Name
7+9 =