Text interpolation

Prefix a string with @ to insert values or expressions.

Example.kalm
pub fun greeting(name: Text) -> Text:
    return @"Hello, $name! ${2 + 3} notes today."
Example.kalm
pub fun greeting(name: Text) -> Text {
    return @"Hello, $name! ${2 + 3} notes today."
}
Example.kalms
fun greeting(name: Text) -> Text:
    return @"Hello, $name! ${2 + 3} notes today."
Example.kalms
fun greeting(name: Text) -> Text {
    return @"Hello, $name! ${2 + 3} notes today."
}
Example.java
public final class Example {
    public static String greeting(String name) {
        return "Hello, " + name + "! " + (2 + 3) + " notes today.";
    }
}

Learn more.