This article has not been added to any content categories. Please help out by adding categories to it so that it can be listed with similar articles. |
Concatenation
Common variants:
- BASIC, Pascal, Delphi, Javascript, Java, Python, C++ and Ruby ;; "+".
- Perl, PHP, Maple ;; "." sign.
- Perl 6 ;; "~" sign.
- Standard SQL, PL/I, Rexx, and Maple (from version 6) ;; double pipe signs ("||").
- Mathematica ;; "<>".
- Lua ;; "..".
- The J programming language ;; ",".
- AppleScript and VHDL ;; "&".
- OCaml ;; "^".
Unique variants:
- Visual Basic uses the "&" sign. Versions 1 to 6 can also use the "+" sign but this leads to ambiguity if a string representing a number and a number is added together.
- MATLAB uses the syntax "[x y]" to concatenate x and y.
- C allows juxtaposition for string literals, however, for strings stored as character arrays, the strcat function must be used.
- Octave uses the syntax "[x, y]" to concatenate x and y.
- Awk uses the empty string: You just have to write two expressions adjacent to each other to concatenate them. This is called Juxtaposition. Unix shells have a similar syntax. Rexx uses this syntax for concatenation including an intervening space.
String literals
This section compares styles for declaring a string literal.
Quoted raw
<![CDATATheQuickBrownFox> ;; CDATA section ;; XML
Quoted interpolated
todo
Dual quoting
todo
Multiple quoting
todo
Unique quoting variants
16HTheQuickBrownFox ;; Hollerith notation ;; Fortran (indented with whitespace) ;; Indented with whiteapce and newlines ;; YAML