stripLines

emlib.textlib.stripLines(text, which='all', splitregex='')[source]

Strip leading and trailing empty lines

Parameters:
  • text (str) – the text to work on

  • which – one of ‘all’, ‘top’, ‘bottom’, where all removes all empty lines at the top and bottom, top removes only leading empty lines and bottom removes only trailing empty lines

Returns:

the transformed text