Strip Html Tags
Join the DZone community and get the full member experience.
Join For FreeOriginally from segabor@textsnippets
The regex below removes html tags from string (untested).
str = <
Application error
Change this error message for exceptions thrown outside of an action (like
in Dispatcher setups or broken Ruby code) in public/500.html
HTML_TEXT
puts str.gsub(/<\/?[^>]*>/, "")
Stripes (framework)
Opinions expressed by DZone contributors are their own.
Comments