Is there a way in Kotlin to deal with an encoded S...
# android
n
Is there a way in Kotlin to deal with an encoded String so that the hyperlink address does not appear? Like in this example: "Ministers have rebuffed an offer by nursing unions to suspend <a href="https://www.theguardian.com/society/2022/nov/09/nurses-in-uk-vote-to-go-on-strike-for-first-time-in-dispute-over-pay">planned strikes</a> in return for negotiations on pay". What I would like instead would be "Ministers have rebuffed an offer by nursing unions to suspend planned strikes in return for negotiations on pay".
😶 2
c
It’s not really Kotlin related ;-) But you can have a look at
SpannableString
from the android framework. This should give you some hints on how to handle HTML in an android textview.
n
Ok thanks for the pointer! Sorry it wasn't specifically Kotlin related. 😊
Turns out it is simple:
String.parseAsHtml()
👍 1