def ireplace(old, new, string):
    """Returns a copy of `string` where all the occurrences of a
    case-insensitive search after `old` is replaced with `new`.

    :param old: the item in `string` to do a case insensitive search after.
    :param new: new item to replace `old` with.
    :param string: string to search-and-replace `old` with `new` in.
    """
    idx = 0
    while idx < len(string):
        index = string.lower().find(old.lower(), idx)
        if index == -1:
            return string
        string = string[:index] + new + string[index + len(old):]
        idx = index + len(old)
    return string