def replstring(string, i, j, repl):
    """
    Replace everything in string between and including indices i and j with repl
    >>> replstring("abc", 0, 0, "c")
    'cbc'
    >>> replstring("abc def LOL jkl", 8, 10, "ghi")
    'abc def ghi jkl'
    """
    # Convert to list since strings are immutable
    strlist = list(string)
    # Delete characters between given indices
    for k in range(j - i + 1):
        del strlist[i] # i instead of k, since deleting an element makes list smaller

    # Insert new chars
    for l in range(len(repl)):
        strlist = strlist[:i + l] + [repl[l]] + strlist[i + l:]
    return "".join(strlist)