def substring(entry, start, length):
    """
    >>> substring(None, 12, 6)
    ''
    >>> substring("tooshort", 12, 6)
    ''
    >>> substring("thisverylongstringshouldbetruncated", 12, 6)
    'string'
    >>> substring("thisstringshouldnotbetruncated", 0, 30)
    'thisstringshouldnotbetruncated'
    """
    if entry is None or len(entry) < start:
        return ""
    elif len(entry) < start + length:
        return entry[start:]
    else:
        return entry[start:start+length]