13 lines
1.1 KiB
Plaintext
13 lines
1.1 KiB
Plaintext
{{basic data operation}}
|
|
{{omit from|NSIS}}{{omit from|BBC BASIC}}
|
|
Given a string and defined variables or values, [[wp:String literal#Variable_interpolation|string interpolation]] is the replacement of defined character sequences in the string by values or variable values.
|
|
: For example, given an original string of <code>"Mary had a X lamb."</code>, a value of "big", and if the language replaces X in its interpolation routine, then the result of its interpolation would be the string <code>"Mary had a big lamb"</code>.
|
|
|
|
:(Languages usually include an infrequently used character or sequence of characters to indicate what is to be replaced such as "%", or "#" rather than "X").
|
|
|
|
;The task is to:
|
|
# Use your languages inbuilt string interpolation abilities to interpolate a string missing the text <code>"little"</code> which is held in a variable, to produce the output string <code>"Mary had a little lamb"</code>.
|
|
# If possible, give links to further documentation on your languages string interpolation features.
|
|
|
|
<small>Note: The task is not to create a string interpolation routine, but to show a language's built-in capability.</small>
|