Answers for "python make string one line"

0

python make string one line

s = "a\nb\nc\nd\n"
t = str.join(" ", s.splitlines())
#output "a b c d"
Posted by: Guest on July-23-2021

Python Answers by Framework

Browse Popular Code Answers by Language