Anonymous user
String prepend: Difference between revisions
→{{header|Icon}} and {{header|Unicon}}, added another sample using augmented assignment with String Scanning
Line 624:
s := ", world"
s[1:1] ||:= "Hello"
write(s)
end</lang>
{{out}}
<pre>prompt$ unicon -s prepend.icn -x
Hello, world</pre>
Another take on it, using String Scanning:
<lang unicon>procedure main()
(s := ", world") ?:= "Hello" || tab(0)
write(s)
end</lang>
|