With Scala it’s common to embed variables in strings like this with the
s string interpolator:
val name = "Fred"
println(s"My name is $name.")
That’s cool, but when you need to format your string, Scala gives you an even more powerful tool: the
f string interpolator. Here’s an example of how I just did this in my LittleLogger logging library: