Skip to content

Instantly share code, notes, and snippets.

View fauxtrot's full-sized avatar

Todd Richardson fauxtrot

  • Cognizant/Softvision
  • Dallas, TX
View GitHub Profile
export class StringHelpers {
static format(format: string, ...args: any[]) : string {
var i;
if (args instanceof Array) {
for (i = 0; i < args.length; i++) {
format = format.replace(new RegExp('\\{' + i + '\\}', 'gm'), args[i]);
}
return format;
}
for (i = 0; i < arguments.length - 1; i++) {