String append: Difference between revisions

jq (header)
(jq)
(jq (header))
Line 198:
"Goodbye, World!"
</pre>
=={{header|jq}}==
 
jq's <code>+</code> operator can be used to append two strings, and under certain circumstances the <code>+=</code> operator can be used as an abbreviation for appending a string to an existing string. For example, all three of the following produce the same output:<lang jq>"Hello" | . += ", world!"
 
Line 204:
 
{ "greeting": "Hello"} | .greeting += ", world!" | .greeting</lang>
However the <code>+=</code> operator cannot be used with jq variables in the conventional manner. One could howevernevertheless use the technique illustrated by the following:<lang jq>"Hello" as $a | $a | . += ", world!" as $a | $a</lang>
 
=={{header|Julia}}==
2,502

edits