def _clean(target_str: str, is_cellref: bool=False) ->str:
    """Rids a string of its most common problems: spacing, capitalisation,etc."""
    try:
        output_str = target_str.lstrip().rstrip()
    except AttributeError:
        raise AttributeError('Cannot clean value other than a string here.')
    if is_cellref:
        output_str = output_str.upper()
    return output_str
