def check_integer(text):
    text = text.strip()
    if not text:
        return False
    if text[0] in ('+', '-'):
        text = text[1:]
    return text.isdigit()