String.prototype.formatUnicorn = String.prototype.formatUnicorn ||
function () {
    "use strict";
    var str = this.toString();
    if (arguments.length) {
        var t = typeof arguments[0];
        var key;
        var args = ("string" === t || "number" === t) ?
            Array.prototype.slice.call(arguments)
            : arguments[0];

        for (key in args) {
            str = str.replace(new RegExp("\\{" + key + "\\}", "gi"), args[key]);
        }
    }

    return str;
};

String.prototype.removeLeading = String.prototype.removeLeading ||
function (leading) {
    if(this.startsWith(leading)){
        return this.slice(leading.length);
    }
    return this;
}

if(String.prototype.toBoolean)
    console.error('Trying to overwrite String.prototype.toBoolean');

String.prototype.toBoolean =
function () {
    switch(this.toLowerCase()){
        case 'yes':
        case 'true':
        case '1':
            return true;
        case 'no':
        case 'false':
        case '0':
            return false;
    }
    console.error("String.prototype.toBoolean: Boolean value not reckognized:",this);
}
