String interpolation (included): Difference between revisions

Content added Content deleted
(Add Uiua)
(Add ed example)
 
Line 1,052: Line 1,052:
STD.Str.FindReplace('Mary had a X Lamb', 'X','little');
STD.Str.FindReplace('Mary had a X Lamb', 'X','little');
</syntaxhighlight>
</syntaxhighlight>

=={{header|ed}}==

<syntaxhighlight lang="sed">
# by Artyom Bologov
H
,p
# Add a vertical bar to separate the template and value
2s/^/|/
,j
# Replace and print
s/X\(.*\)|\(.*\)/\2\1/p
Q
</syntaxhighlight>

{{out}}

<pre>$ ed -s interpolation.input < interpolation.ed
Newline appended
Mary has a X lamb
big
Mary has a big lamb</pre>


=={{header|Elena}}==
=={{header|Elena}}==