graylog-plugin-pipeline-processor icon indicating copy to clipboard operation
graylog-plugin-pipeline-processor copied to clipboard

String interpolation

Open joschi opened this issue 9 years ago • 1 comments

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}!"""

joschi avatar Aug 23 '16 09:08 joschi

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

lennartkoopmann avatar Aug 27 '16 23:08 lennartkoopmann