replace-string:替换字符串中的所有子字符串匹配项

时间:2021-05-26 07:53:49
【文件属性】:
文件名称:replace-string:替换字符串中的所有子字符串匹配项
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-26 07:53:49
JavaScript 替换字符串 替换字符串中的所有子字符串匹配项 与String#replace()类似,但支持替换多个匹配项。 通过将字符串放入带有全局标志的RegExp构造函数中并将其传递给String#replace() ,可以实现类似的效果,但是无论如何,您首先必须转义该字符串。 使用, 现在有了一个方法,因此该程序包部分没有意义。 但是,它没有caseInsensitive选项。 安装 $ npm install replace-string 用法 const replaceString = require ( 'replace-string' ) ; const string = 'My friend has a :ewe:. I want a :ewe: too!' ; replaceString ( string , ':ewe:' , ':unicorn:' ) ; //=> 'My friend has a :unicorn:. I wa
【文件预览】:
replace-string-main
----.gitignore(23B)
----package.json(778B)
----.npmrc(19B)
----index.js(1KB)
----test.js(3KB)
----.github()
--------workflows()
--------funding.yml(91B)
----license(1KB)
----readme.md(2KB)
----index.test-d.ts(753B)
----.gitattributes(19B)
----.editorconfig(175B)
----index.d.ts(1KB)

网友评论