Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Properties; public class Main { static String extractComment(String tag, Properties properties) { if (properties == null || "span".equals(tag)) { return null; } String[] attributes = new String[] { "id", "name", "class" }; for (String a : attributes) { String comment = properties.getProperty(a); if (comment != null) { return "<span class=\"com\"><!-- " + comment.replaceAll("[-]{2,}", "-") + " --></span>"; } } return null; } }