def trim_iterable(iterable, limit, *, split=None, prefix='', postfix=''):
    """trim the list to make total length no more than limit.If split specified,a string is return.
    :return:
    """
    if split is None:
        sl = 0
        join = False
    else:
        sl = len(split)
        join = True
    result = []
    rl = 0
    for element in iterable:
        element = prefix + element + postfix
        el = len(element)
        if len(result) > 0:
            el += sl
        rl += el
        if rl <= limit:
            result.append(element)
        else:
            break
    if join:
        result = split.join(result)
    return result
