Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

replace newline character in python

s_lines = 'one
two
three'
print(s_lines)
# one
# two
# three

print(s_lines.replace('
', '-'))
# one-two-three
Source by note.nkmk.me #
 
PREVIOUS NEXT
Tagged: #replace #newline #character #python
ADD COMMENT
Topic
Name
6+6 =