strip_empty_lines function

(Shortest import: from brian2.utils.stringtools import strip_empty_lines)

brian2.utils.stringtools.strip_empty_lines(s)[source]

Removes all empty lines from the multi-line string s.

Examples

>>> multiline = '''A string with
...
... an empty line.'''
>>> print(strip_empty_lines(multiline))
A string with
an empty line.