Answers for "python replace newline from string"

1

python replace newline

without_line_breaks = a_string.replace("n", " ")
Posted by: Guest on November-11-2020
0

replace newline character in python

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

print(s_lines.replace('n', '-'))
# one-two-three
Posted by: Guest on January-03-2022

Code answers related to "python replace newline from string"

Python Answers by Framework

Browse Popular Code Answers by Language