def is_empty(string, trim_spaces=True, chars=None):
    """:yaql:isEmpty

    Returns true if the string with removed leading and trailing chars is
    empty.

    :signature: string.isEmpty(trimSpaces => true, chars => null)
    :receiverArg string: value to be checked for emptiness after trim
    :argType string: string
    :arg trimSpaces: true by default, which means string to be trimmed with
        chars. false means checking whether input string is empty
    :argType trimSpaces: boolean
    :arg chars: symbols for trimming. null by default, which means trim is
        done with whitespace characters
    :argType chars: string
    :returnType: boolean

    .. code::

        yaql> "abaab".isEmpty(chars=>"ab")
        true
        yaql> "aba".isEmpty(chars=>"a")
        false
    """
    if string is None:
        return True
    if trim_spaces:
        string = string.strip(chars)
    return not string