Can't you make it a oneliner?

$s = function(s) {
  return eval("'" + s.replace(/#{/g, "' + ").replace(/}/g, " + '") + "'");
}

more place for bloated functions :)

-- David

weepy schreef:
or even

$s = function(s) {
  p = s.replace(/#{/g, "' + ").replace(/}/g, " + '")
  p = "'" + p + "'"
  return eval(p)
}


Reply via email to