`delete` returns the string that was deleted, not the modified string -- you would need to then `return string` after this line.