let value="1x0.038x0.025"; let n = '12345'; let reg = /.*?(?=x)/; value = value.replace(reg, n); alert(value);
let value="1x0.038x0.025"; let n = '12345'; let ar = value.split("x"); ar[0] = n; value = ar.join("x") alert(value);