3 ms·
That's actually a really clever mechanism. Although it'll make the common case (basic string interpolation, no need for security concerns) more complicated unl
by MrJohz 2y ago
That's actually a really clever mechanism. Although it'll make the common case (basic string interpolation, no need for security concerns) more complicated unless a lot of APIs support a StringTemplate overload.
- darylteo 2y agoThis could be supported with String constructor with StringTemplate overload. String str = new String("Hello \{name}"); OR just add a .interpolate() function String str = "Hello \{name}".interpolate(); // verbose String str = "Hello \{name}".join(); // less verbose, but less representative OR probably at the bottom of the list of recommendations String str = "Hello \{name}".toString() // matches StringBuilder behaviour Knowing Java devs, also a non-zero chance it becomes String str = "Hello \{name}".toUnsafeString() Quoting Brian: > shed to be painted (but please, not right now.).