Skip to content

Instantly share code, notes, and snippets.

@tjbrennan
Created October 12, 2015 18:47
Show Gist options
  • Save tjbrennan/5626fc73f2ddb2f2bdc1 to your computer and use it in GitHub Desktop.
Save tjbrennan/5626fc73f2ddb2f2bdc1 to your computer and use it in GitHub Desktop.
function multiline (func) {
var str = func.toString();
var result = str.substring(str.indexOf('/*')+2, str.indexOf('*/'));
return result;
}
function foo () {/*
I am
a multiline
string
*/};
console.log(multiline(foo));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment