Tuesday, 13 March 2012

JavaScript Replace all match string through Regular Expression


function ReplaceAll(txt, replace, with_this) {
    return txt.replace(new RegExp(replace, 'g'), with_this);
}

No comments:

Post a Comment