Javascript String fmt(hash)

Description

Javascript String fmt(hash)


String.prototype.fmt = function (hash) {
    var string = this, key;
    for (key in hash) string = string.replace(new RegExp('\\{' + key + '\\}', 'gm'), hash[key]);
    return string
};



PreviousNext

Related