Fix replace bug

This commit is contained in:
Rhys Arkins 2017-01-11 12:16:10 +01:00
parent 32a9993b1e
commit 9e4aac1d14

View file

@ -41,5 +41,5 @@ function matchAt(content, index, match) {
// Replace oldString with newString at location index of content // Replace oldString with newString at location index of content
function replaceAt(content, index, oldString, newString) { function replaceAt(content, index, oldString, newString) {
return content.substr(0, index) + newString + content.substr(index, oldString.length); return content.substr(0, index) + newString + content.substr(index + oldString.length);
} }