Can delphi do template literals like js ?

Can delphi do template literals like js ?

e.g
Var x = "John"

Var Msg = `Hello {x} thank you for coming today`

The same can be done in C#, but I can't find if delphi can do this or not

Comments

  1. If you could provide some context it would be better. There's a lot of things you can't do in Delphi in your example: Initialize a variable, declare a variable in the middle of a block, and replace {x} with the variable content.
    On the other hand, there's a lot of things delphi can do (that JS can't) that helps improve code readability, localization , memory management to name a few.

    ReplyDelete
  2. Clement Doss You can initialize a global variable in Delphi.

    ReplyDelete
  3. Uwe Raabe Yeap. But do you know if x is global?

    ReplyDelete

Post a Comment