Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

String interpolation #95

Open
joschi opened this issue Aug 23, 2016 · 1 comment
Open

String interpolation #95

joschi opened this issue Aug 23, 2016 · 1 comment

Comments

@joschi
Copy link
Contributor

joschi commented Aug 23, 2016

Constructing new strings from several sub-strings and variables is currently quite cumbersome.

Imagine the need to construct the string "Hello, world!" from the variable subject and the string template "Hello, %s!":

let greeting = concat(concat("Hello, ", subject), "!");

Being able to either use the + operator to concatenate strings and variables or allowing interpolation in the first place would make this much simpler:

// Imaginary + operator
let greeting_concat = "Hello, " + subject + "!";

// Imaginary string interpolation similar to Groovy or Scala
let greeting_interpolate = """Hello, ${subject}!"""
@lennartkoopmann
Copy link
Contributor

I was just about to open this issue. Super helpful function!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants