I have large string which I split by newlines. How can I remove all lines that are empty, (whitespace only)?
pseudo code:
for stuff in largestring:
you can simply use rstrip:
for stuff in largestring: print(stuff.rstrip("\n")