def replace_x0_and_x1_with_vect(s, xyz=['x', 'y', 'z']):
    """Replaces strings x0 with x[:-1],  x1 with x[1:], y0 with y[:-1] ...

    Parameters
    ----------
    s : string, or sympy_expression
        Expression to make replacements on
    xyz : list of strings
        Replacements will be made for each element of xyz.
        default xyz=['x','y','z'].

    Returns
    -------
    out : string
        string with all replacements made

    """
    endings = ['[:-1]', '[1:]']
    s = str(s)
    for x in xyz:
        for i, ending in enumerate(endings):
            s = s.replace('{}{:d}'.format(x, i), '{}{}'.format(x, ending))
    return s
