I have a problem I am quite stuck with. I have a snippet of code that I am reading in as a string, but I would like to remove a specific portion of it.
/**
* This file is autoupdated by build.xml in order to set revision id.
*
* @author Damian Minkov
*/
public class RevisionID
{
/**
* The revision ID.
*/
public static final String REVISION_ID="0";
}
For example, the above snippet of code. I would like to replace all the comments (everything between /** and */).
How would I go about doing this?
Right now, this is the attempt I am working with;
var sposC = temp.indexOf('/*');
console.log(sposC);
var eposC = temp.indexOf('*/');
console.log(eposC);
var temp1 = temp.replace(eposC + sposC, '1');
It is not working though, so may someone please help me.