1.正则表达式
2.replace
var data={ t1:‘1111‘, t2:‘2222‘, } var str = ‘abcadeacf‘; var str1 = str.replace(/a/g, data.t1); console.log(str1)
原文地址:https://www.cnblogs.com/fm060/p/8542915.html
时间: 2024-11-04 10:41:27
1.正则表达式
2.replace
var data={ t1:‘1111‘, t2:‘2222‘, } var str = ‘abcadeacf‘; var str1 = str.replace(/a/g, data.t1); console.log(str1)
原文地址:https://www.cnblogs.com/fm060/p/8542915.html