refactor(util) removeStrOneTime, ownRender

This commit is contained in:
coderaiser 2014-03-04 04:15:15 -05:00
parent 3239e38e8f
commit b16dd92a48

View file

@ -513,23 +513,23 @@
* @param pStr
* @param pSubStr
*/
this.removeStrOneTime = function(pStr, pSubStr) {
var lRet = Util.isString(pStr) && pSubStr;
this.removeStrOneTime = function(str, substr) {
var n, isArray,
isString = Util.isString(str);
if ( lRet ) {
var n = pSubStr.length;
if (isString && substr) {
n = substr.length;
isArray = Util.isArray(substr);
if ( Util.isArray(pSubStr) )
Util.fori(n, function(i) {
lRet = pStr = pStr.replace(pSubStr[i], '');
});
if (!isArray)
str = str.replace(substr, '');
else
lRet = pStr.replace(pSubStr, '');
Util.fori(n, function(i) {
str = str.replace(substr[i], '');
});
}
else
lRet = pStr;
return lRet;
return str;
};
/**
@ -602,7 +602,7 @@
}
expr = firstChar + '.*' + secondChar;
ret = Util.replaceStr(templ, expr, '', notEscape);
ret = Util.replaceStr(ret, expr, '', notEscape);
return ret;
};