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
def split_clean(line, delim): """Splits line, strips results, and returns list""" return lists.strip_space(line.split(delim))