Rewrite String Concatenation
Rewrite String Concatenation turns a + chain of three or more parts into the equivalent backtick interpolation. Here "Hello " + name + "!" is three parts, so EK9 refuses it - E11068, explained in the Hovers panel. To play it in the IDE: Help > Lessons > Refactoring…, or ek9 -ide -lesson rewrite-string-concat.
Start from
The code the lesson starts from: copy it into a file of your own and follow the steps.
Fails with E11068: string concatenation with 3+ parts - use string interpolation instead
#!ek9 defines module error.e11068.bad defines function threePartChain() -> name as String <- result as String: String() result: "Hello " + name + "!" fourPartChain() -> first as String last as String <- result as String: String() result: first + " " + last + " here" fivePartChainWithDollar() -> x as Integer y as Integer <- result as String: String() result: "(" + $x + ", " + $y + ")"
Step 1: Where it is
Put the caret on Hello, on line 9.
Step 2: Rewrite String Concatenation
Right-click it - or choose Refactor > Refactor This… - and choose Localisation > Rewrite to Backtick Interpolation.
Step 3: Preview and apply
The preview shows every change the refactoring makes; then the IDE formats each file it changed. Choose Apply.
The result
That is Rewrite String Concatenation: "Hello " + name + "!" is Hello ${name}!, one allocation instead of three. The four- and five-part chains below it are the same refactoring - try one yourself. It is on the right-click menu wherever the caret is inside a + concatenation; AI assistants use the ek9_rewrite_string_concat tool.
Where this lesson comes from
- The errors it fixes - each one's explanation offers this lesson: E11068.
- Answers -
ek9 -qand the IDE's Answers tab: 309, 174, 313. - For AI assistants - the MCP tool
ek9_rewrite_string_concat.



