I want to replace text between two indices in Javascript, something like:
str = "The Hello World Code!";
str.replaceBetween(4,9,"Hi");
// outputs "The Hi World Code"
The indices and the string are both dynamic.
How could I go about doing this?
See Question&Answers more detail:os