import re
import string


def clean_str(inp_str: str) -> str:
    """Removes non printable characters from the string

    Reference:
    https://stackoverflow.com/a/52540226

    Arguments:
        inp_str {str} -- The input string, to be cleaned.

    Returns:
        {str} -- The cleaned string
    """
    return re.sub(f'[^{re.escape(string.printable)}]', '', inp_str)