2 ms·
Scala seems to do what you want: val str = s""" Tripe quoted string interpolation Allows for $variables and ${method.foo(bar)} Mixed with
by virtualwhys 11y ago
Scala seems to do what you want:
val str = s"""
Tripe quoted string interpolation
Allows for $variables and ${method.foo(bar)}
Mixed with "quotes"
"""
Can also use double quoted string interpolation for inline/one-liners where embedded quotes above aren't needed.
- insulanian 11y agoF# can have quotes inside triple-quoted string like Scala, sans interpolation.
- Pxtl 11y agoNeat! With facilities like that, Id be tempted to skip templating libraries altogether and just have a normal interface for templates and use the regular string expressions... Unless I needed then internationalized, and that's where Mustache shines, IMHO.