RosettaCodeData/Task/String-interpolation-included-/Transd/string-interpolation-included-.transd

17 lines
376 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
#lang transd
MainModule: {
size: "little",
_start: (λ
// Transd supports direct interpolation
(with s String("Mary had a " size " lamb.")
(lout s))
// To interpolate a string variable within another
// string variable we use 'replace'
(with s "Mary had a %s lamb."
(lout (replace s "%s" size)))
)
}