import re


def strip_line_breaks(s):
    """
    Remove \r and \n chars, replacing with a space. Strip leading/trailing
    whitespace on each line. Remove blank lines.
    """
    return re.sub(r'[\r\n ]+', ' ', s).strip()