Browse Source

Pull request #1360: 无JIRA任务 replaceAll实现修改一下

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'ecc10cb6041b908342a757f5437f96c9d27cfe0e':
  无JIRA任务 replaceAll实现修改一下
master
windy 5 years ago
parent
commit
da4c3beee8
  1. 2
      src/core/func/string.js

2
src/core/func/string.js

@ -81,7 +81,7 @@ _.extend(BI, {
* @returns {String} 替换后的字符串
*/
replaceAll: function (str, s1, s2) {
return BI.isNull(str) ? str : str.replace(new RegExp(s1, "gm"), s2);
return BI.isString(str) ? str.replace(new RegExp(s1, "gm"), s2) : str;
},
/**
* 总是让字符串以指定的字符开头

Loading…
Cancel
Save