Currently I'm having a requirement of HTML entity encode / decode using Ballerina language. However I couldn't find any references for that.
If I have a string as following,
https://spdx.org/licenses/Apache-2.0.html
Expected result would be,
https://spdx.org/licenses/Apache-2.0.html
You can refer to the following screenshot where I have done the same thing using an online tool : https://mothereff.in/html-entities
How can we achieve the above?

There is no direct Ballerina module that provides this functionality. But it can be done using the Java interoperability feature in the Ballerina language.
The StringEscapeUtils class of Apache common-text library can be used for this.
Steps:
bal new <project name>command.bal bindgen -mvn org.apache.commons:commons-text:1.9 org.apache.commons.text.StringEscapeUtilsBuild the project using
bal buildcommand.Write the Ballerina code for encode and decode.
For more details refer to the Java interoperability guide on Ballerina.