Created
May 21, 2011 20:55
-
-
Save ashaw/984889 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// thx: https://github.com/bcherry/twitter-text-js/blob/master/twitter-text.js | |
var stringSupplant = function(str, values) { | |
return str.replace(/#\{(\w+)\}/g, function(match, name) { | |
return values[name] || ""; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment