Last active
December 15, 2015 22:09
-
-
Save alexlawrence/5330926 to your computer and use it in GitHub Desktop.
String.format like in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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