Search code examples
stringstring-interpolationnim-lang

String interpolation


In scala, you easily include the content of a variable inside a string, like this:

val nm = "Arrr"
println(s"my name is , $nm")

Is this possible in nim, and in that case, how?


Solution

  • The strfmt module features some experimental string interpolation:

    import strfmt
    let nm = "Arrr"
    echo interp"my name is $nm"