From 0af3973929cd0ccecf10fd9c4f0121a0050c657f Mon Sep 17 00:00:00 2001 From: stefanp Date: Tue, 24 Jun 2003 11:17:57 +0000 Subject: [PATCH] added static chopComment() which chops everything after a closing comment tag --- src/helma/doc/Util.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/helma/doc/Util.java b/src/helma/doc/Util.java index cc77a912..c00c0c5b 100644 --- a/src/helma/doc/Util.java +++ b/src/helma/doc/Util.java @@ -50,6 +50,23 @@ public final class Util { } } + /** + * chops anything that comes after a closing comment tag + * + * @param raw comment + * + * @return chopped comment + */ + public static String chopComment (String comment) { + int idx = comment.indexOf ("*/"); + if (idx>0) { + return comment.substring (0, idx+2); + } else { + return comment; + } + } + + /** * reads a complete file *