Skip to content

Instantly share code, notes, and snippets.

@alexlawrence
Last active December 15, 2015 22:09
Show Gist options
  • Save alexlawrence/5330926 to your computer and use it in GitHub Desktop.
Save alexlawrence/5330926 to your computer and use it in GitHub Desktop.
String.format like in C#
String.format = function(f) {
return Array.prototype.slice.call(arguments,1).reduce(function(o,v,i){return o.replace('{'+i+'}',v);},f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment