def trim(inp_str, symbol):
    """ Trim a string up to a symbol
    Parameters
    ----------
    inp_str : string
        input string
    symbol : string
        symbol to split on

    Returns
    -------
    out : string
        trimmed output
    """
    if isinstance(inp_str, str) and isinstance(symbol, str):
        out = symbol.join(inp_str.split(symbol)[:-1])
    else:
        raise TypeError('Trim function requires strings as input!')
    return out