def _parse_until_delim(ctx, fld, delim):
    """ Return False unless delim exists in ctx['str']. Assign ctx['str'] excluding delim to ctx[fld] and assign ctx[str] to the remainder, excluding delim, and return True otherwise."""
    i = ctx['str'].find(delim)
    if (i == -1):
        return False
 
    ctx[fld] = ctx['str'][0:i]
    ctx['str'] = ctx['str'][i+len(delim):]
    return True