title: Kotlin String substitution not working when string is read from file
body: <p>I have written a code that reads a text file. The text files contain placeholders which I would like to replace. The substitution does not work this way and the string is printed with the placeholders. Here is the code that I have written for this:</p>
  
  <pre><code>class TestSub(val sub: Sub) {
  
      fun create() = template()
  
      fun template() = Files.newBufferedReader(ClassPathResource(templateId.location).file.toPath()).readText()
  }
  
  data class Sub(val name: String, val age: Int)
  </code></pre>
  
  <p>Here is the main function that tries to print the final string:</p>
  
  <pre><code>fun main(args: Array&lt;String&gt;) {
      val sub = Sub("Prashant", 32)
  
      println(TestSub(sub).create())
  }
  </code></pre>
  
  <p>However, when, instead of reading a file, I use a String, the following code works (Replacing <code>fun template()</code>)</p>
  
  <pre><code>fun template() = "&lt;h1&gt;Hello ${sub.name}. Your age is ${sub.age}&lt;/h1&gt;"
  </code></pre>
  
  <p>Is there a way to make string Substitution work when reading the content of a file?</p>