How can i remove from a string between two indexOf
i have this jsFiddle
here is my code :
var x = "M 178.6491699876038 23.419570090792845 C 183.6491699876038
23.419570090792845 186.47776067057902 30.902823043098138 190.3670728596699
41.19229585251793 L 194.25638504876076 51.48176866193772" ;
var c = x.indexOf('C') ;
var L = x.indexOf('L') ;
var final = x.slice (c,L) ;
console.log(final) ;
this code will result in returning the removed part of the string
QUESTION how can i return the original string after removing the part between C and L