Format a string with '{0}','{1}'...
اعتبارا من
لا ينبغي أن لا يتم تثبيت هذا السكريت مباشرة. هو مكتبة لسكبتات لتشمل مع التوجيه الفوقية // @require https://update.greasyfork.org/scripts/453846/1110440/string%20format.js
(function () {
"use strict";
if (!String.prototype.format) {
String.prototype.format = function () {
var args = arguments;
return this.replace(/{(\d+)}/g, (match, number) => {
return typeof args[number] != 'undefined' ? args[number] : match;
});
};
} else {
throw 'String.prototype.format defined.';
}
})();