global
def trim_empty_lines_around(s) # this deletes the trailing newline, which may need to be reconstructed
def trim_empty_lines_around(s) # this deletes the trailing newline, which may need to be reconstructed s.sub(/\A(\r?\n)*/, '').sub(/(\r?\n)*\z/, '') end