Hello everybody,
As topic’s title, is there any solution for this problem?
I want to load string from html template file in assets folder and it should be modify (eg: fill data to form) before display to view. So how can convert html string to template string in kotlin or any solution for my problem.
Kotlin string templates are always processed statically at compile time. There are plenty of existing template languages (Velocity, Freemarker etc.) that you can use for substituting values into a template at runtime.
Glad I found this post. I work on the MyBatis project, and I’ve been exploring the use of Kotlin as an alternative scripting language. The fact that it only allows for templates to be processed at compile time makes it unusable for that purpose. MyBatis already has implementation for Velocity and Freemarker, so I’ll go back to working on my Groovy implementation using GString templates. Thanks for clarifying!