DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Ruby: Strip Html Tags From A String
str = "<html>This and <b>that</b> and <br />and <span class='something'>the other</span>?<html>" puts str.gsub(/<\/?[^>]*>/, "")






Comments
Snippets Manager replied on Sun, 2009/03/01 - 6:48am
Snippets Manager replied on Sat, 2007/07/21 - 5:27pm