Splicing with indexof