_.replace(字符串替换)
Last updated
Was this helpful?
Last updated
Was this helpful?
语法:
源代码链接:
npm包链接:
描述:
替换string
字符串中匹配的pattern
为给定的replacement
。
注意:这个方法基于。
可使用正则替换。
开始版本:4.0.0
参数:
[string=''] (string)
: 待替换的字符串。
pattern (RegExp|string)
: 要匹配的内容。
replacement (Function|string)
: 替换的内容。
返回值:
(string)
: 返回替换后的字符串
例子: