def to_int(s):
    """
    Return <s> as an integer if possible. Else None.
    :param s: str
    :return: int (or None)
    """
    if s:
        try:
            out = int(s)
        except ValueError:
            out = None
    else:
        out = None
    return out