I am developing web app using Scala and Lift framework. I have record in DB which contains html perex of page
<b>Hi all, this is perex</b>
And in one scenario I need to print to user this perex, but without html tags.
Hi all, this is perex
It is possible to do this in Scala? Because I tried to look with Google, but with no success.
thanks for all replies.
If the string is valid XML then you can use:
scala.xml.XML.loadString("<b>Hi all, this is parex</b>").text
If it's not valid XML, then you can use scala.util.matching.Regex
or an HTML parsing library like http://jsoup.org/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With