I think the best solution would be to use a JavaScript replacement method for strings.
W3Schools has a good low below here . It should do exactly what you want, but it can replace ALL the numbers you specified, so be sure to say something like var replacement = str.replace("2 ", "28 ");
EDIT: Indicates a good flaw. Instead, you can try:
EDIT2: Opps, had some flaws in the source code. Tested and works great! :)
function replaceNumbers(x1, x2, str) { var strMod = " " + str + " " var x1Mod = " " + x1 + " " var x2Mod = " " + x2 + " "
source share