84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
假如用jq,可以直接用replaceAll语法进行替换,但是查了Zeptojs的文档,是没有这个属性的,那使用Zeptojs要怎么把逗号“,”替换成“-”,在线求解????
人生最曼妙的风景,竟是内心的淡定与从容!
Regular Expression
var text = $($0).val();text = text.replace(/,|,/g,'-');// var text = '使用,Zeptojs,框架怎么替换字符串';// text = text.replace(/,|,/g,'-'); --> "使用-Zeptojs-框架怎么替换字符串"
zepto虽然没有,但是可以使用原生js方法替换字符串啊
var str="hello,world"; str.replace(/,/,"-"); //hello-world
一切框架的本质都是原生javascript
Regular Expression
var text = $($0).val();
text = text.replace(/,|,/g,'-');
// var text = '使用,Zeptojs,框架怎么替换字符串';
// text = text.replace(/,|,/g,'-'); --> "使用-Zeptojs-框架怎么替换字符串"
zepto虽然没有,但是可以使用原生js方法替换字符串啊
一切框架的本质都是原生javascript