1.正则表达式
2.replace
var data={ t1:'1111', t2:'2222', } var str = 'abcadeacf'; var str1 = str.replace(/a/g, data.t1); console.log(str1)