I have a list of lines of text: textlines
which is a list of strings (ending with '\n'
).
I would like to remove multiple occurence of lines, excluding those that contains only spaces, line feeds and tabs.
In other words, if the original list is:
textlines[0] = "First line\n"
textlines[1] = "Second line \n"
textlines[2] = " \n"
textlines[3] = "First line\n"
textlines[4] = " \n"
The output list would be:
textlines[0] = "First line\n"
textlines[1] = "Second line \n"
textlines[2] = " \n"
textlines[3] = " \n"
How to do that ?