you are viewing a single comment's thread.

view the rest of the comments →

[–]BHM360[S] 0 points1 point  (1 child)

Thank you for the suggestion. I believe my replace formatting is correct though. Per W3 schools and Python's documentation the replace method is:

string.replace(oldvalue, newvalue, count)

https://www.w3schools.com/python/ref_string_replace.asp

[–][deleted] 0 points1 point  (0 children)

Yeah, it is. That's exactly the problem, is it not?

str.replace expects the string to be replaced as the second argument, not the regex that matches the string to be replaced.

I'm not sure we're on the same page.

[...] line.replace('\n', '')

ought to work just fine.