def get_list(text, delim=',', lower=False):
    """
    Take a string and return trim segments given the delimiter:

         "A,  B,\tC" => ["A", "B", "C"]
    :param text:
    :param delim: delimiter str
    :param lower: True if you want items lowercased
    :return: array
    """
    if not text:
        return []

    data = text.split(delim)
    arr = []
    for v in data:
        _v = v.strip()
        if _v:
            if lower:
                _v = _v.lower()
            arr.append(_v)
    return arr