User Tools

Site Tools


javascript:comments:strip_comments

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
javascript:comments:strip_comments [2020/05/20 19:35] – created peterjavascript:comments:strip_comments [2020/07/15 09:30] (current) – external edit 127.0.0.1
Line 180: Line 180:
 </code> </code>
  
 +Usage is simple - create an instance and call .strip(string) to get back the de-commented string...
 +
 +<code javascript>
 +var cs = new CommentStripper();
 +console.log( cs.strip(someString) );
 +</code>
 +
 +It's intended to be 100% effective - catching any valid comment, including:
 +
 +<code javascript>
 +var a = 10; // comment
 +var a = "http://www.github.com"; // more comments
 +var a = function(arg /*, ...rest */)
 +</code>
 +
 +----
 +
 +===== References =====
 +
 +https://github.com/moagrius/stripcomments
javascript/comments/strip_comments.1590003331.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki