Ejemplo n.º 1
0
def split_at_char(line, char, strip=0):
    """Splits the line into 2, at the first instance of char"""

    ix = line.find(char)
    if ix > -1:
        ret = [line[:ix],
               line[ix+1:]]
    else:
        ret = [line, ""]

    if strip:
        ret = lists.strip_space(ret)

    return ret
Ejemplo n.º 2
0
def split_clean(line, delim):
    """Splits line, strips results, and returns list"""
    return lists.strip_space(line.split(delim))