Is there a way to replace a portion of a String at a given position in java script. For instance I want to replace 00 in the hours column with 12 i
00
12
Another creative idea could be converting into Array, splice and convert it back to String.
splice
let str = "Mar 16, 2010 00:00 AM"; let arr = str.split(""); arr.splice(13,2,"1","2"); str = arr.join("");