I wanted to ask if there is any type of string interpolation in Scala. I have made a search on the subject but \'till now I have found that there is no string interpolation.
You can do it C-style:
"Interpolate my %s here" format List(1,2,3)
//String = Interpolate my List(1, 2, 3) here
or
List(1,2,3) formatted "Interpolate my %s here"
You can use these on anything with a toString (i.e. anything)
case class Foo(n: Int)
Foo(42) formatted "Here is a %s !!!!"
//String = Here is a Foo(42) !!!!
although the former is more flexible in terms of enabling multiple interpolations in a single string (since it can take multiple arguments).