How to remove the first occurrence of a substring from a string with JavaScript

1 Answer

0 votes
var s = "javascript java programming java version java";

s = s.replace('java', '');

document.write(s);
 
     
/*
run:
  
script java programming java version java 
   
*/

 



answered Feb 2, 2019 by avibootz
...