I want to check if my line contains /*
or not. I know how to check if the block comment is in the start:
/* comment starts from the beginning and ends at the end */
if(line.startsWith("/*") && line.endsWith("*/")){
System.out.println("comment : "+line);
}
What I want to know is how to figure the comment is, like this:
something here /* comment*/
or
something here /*comment */ something here
Try using this pattern :