You need to extend the String interface like this:
interface String { stringFormat(...args: string[]): string;}
and you need to implement like this
module Utilities { String.prototype.stringFormat = function (): string { var args = arguments; return this.replace(/\{\{|\}\}|\{(\d+)\}/g, function (m, n) { if (m == "{{") { return "{"; } if (m == "}}") { return "}"; } return args[n]; }); }}
implementation source:Equivalent of String.format in jQuery