From 49d7eec9248999b4a0cbb1a7fd899f1479669fdb Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Jan 2013 06:15:12 -0500 Subject: [PATCH] added replaceStr function --- lib/util.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index fc51632d..5e43be92 100644 --- a/lib/util.js +++ b/lib/util.js @@ -134,7 +134,12 @@ Util = exports || {}; Util.removeStr = function(pStr, pSubStr){ return pStr.replace(pSubStr,''); }; - + + Util.replaceStr = function(pStr, pFrom, pTo){ + var lRet = pStr.replace(new RegExp(pFrom, 'g'), pTo); + return lRet; + }; + /** * invoke a couple of functions in paralel *