how to remove blank lines from string in python

Solutions on MaxInterview for how to remove blank lines from string in python by the best coders in the world

showing results for - "how to remove blank lines from string in python"
Christopher
06 Aug 2018
1re.sub(r'^$\n', '', s, flags=re.MULTILINE)
2