def parse_out_ends(unparsed_string):
    """Parse and remove beginning and end whitespace of a string.

    :param unparsed_string: String with variable terminal whitespaces.
    :type unparsed_string: str
    :returns: String with parsed and removed beginning and ending whitespace.
    :rtype: str
    """
    if not isinstance(unparsed_string, str):
        raise TypeError(f'Paremeter type required is of type list.')
    beginning_trimmed = unparsed_string.lstrip()
    trimmed_string = beginning_trimmed.rstrip()
    return trimmed_string
