当前位置: 首页 > Web前端 > HTML

JS如何替换字符串内容?

时间:2023-03-28 16:52:39 HTML

letstr="VisitMicrosoft!"console.log(str.replace(/Microsoft/,"Taeas"))//预期输出:VisitTaeas!console.log(str.replace("Visit","Look"))//预期输出:看微软!