import functools


def strip_string(original_func):
    """
    Strip white space from a function's argument to float before the function
    operates on it, like:

    Examples
    --------
    >>> @strip_string
    ... def kcmpnm_to_chan(kcmpnm):
    ...     return kcmpnm[:6]
    >>> kclmpnm_to_chan(' my_too_long_component ')
    'my_too'

    """
    @functools.wraps(original_func)
    def converter(hdr):
        return original_func(int(hdr))
    return converter