Last active
December 22, 2015 00:09
-
-
Save lebbe/6387081 to your computer and use it in GitHub Desktop.
Compute the class attribute for a html tag
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HTMLUtil { | |
// ... other code | |
public static String styleClass(String ... styleClasses) { | |
StringBuffer result = new StringBuffer(); | |
result.append("class=\""); | |
for(String styleClass: styleClasses) | |
if(styleClass != null) | |
result.append(styleClass).append(" "); | |
result.append("\""); | |
return result.toString(); | |
} | |
// ... other code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment