View Single Post
  #1 (permalink)  
Old 11-18-04, 04:41 PM
Mr Badger Mr Badger is offline
New Member
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Abolish comments in java code

I'm trying to write some code that will take a commented java file, remove all the comments and leave the code intact. I managed a method to remove // line comments without much bother, but /* ---*/ multiline comments aren't so simple.

I thought it would be fairly simple when I started, but have now created some bizarre recursive methods (and headaches!) without coming up with a solid solution.

Does anyone know of any simple way to do this, is there a something in the java librarys that would do it?
(My text editor doesn't seem to have much of a problem with it.)

Any thoughts??
Reply With Quote