def rep_newlines_with_space(string: str) ->str:
    """Removes newlines and replaces them with spaces.

    Also reduces double spaces to single spaces.
    """
    return string.replace('\n', ' ').replace('  ', ' ')
