Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created May 21, 2011 20:55
Show Gist options
  • Save ashaw/984889 to your computer and use it in GitHub Desktop.
Save ashaw/984889 to your computer and use it in GitHub Desktop.
// 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