Class HtmlUtils


  • public class HtmlUtils
    extends Object
    Bamboo HTML utilities.
    • Constructor Detail

      • HtmlUtils

        public HtmlUtils()
    • Method Detail

      • stripHtml

        @NotNull
        public static @NotNull String stripHtml​(@NotNull
                                                @NotNull String htmlString)
        Strips HTML characters from the given string, returning its content as plain text.

        Examples:

        
         stripHtml("www.example.com") = "www.example.com"
         stripHtml("<a href='example.com'>Hello, World!</a>") = "Hello, World!"
         stripHtml("<div>Lorem<div>ipsum</div></div>") = "Lorem ipsum"
         
        Parameters:
        htmlString - html string
        Returns:
        plain text string