import re


def remove_whitespace(string):
    """if the string contains whitespace sequences, all whitespace is replaced by a
    single space.

    Keyword arguments:
    string -- the string to remove unnecessary whitespace from
    """
    return re.sub(r"\s+", " ", string)