How do i remove an empty line from a string of lines
I have a string which was extracted from a json, the string has multiple lines with data ending with \n some of the lines have no data only the \n. I can't find a way to remove the lines that have only \n in them, please help.
if you have "\n\n" You know your are having an empty line
This feels wasteful, but it works. This is not a best answer; maybe use it to compare examples: print("\n".join(originalText.split("\n\n")))
I will test