Concatenation
Different languages use different symbols for the concatenation operator. Most languages use the "+" symbol, though several deviate from this norm.
Common variants
+ ;; BASIC, C++, Pascal, Delphi, Javascript, Java, Python, Turing programming language, Ruby & ;; Ada, AppleScript, VHDL, Visual Basic . ;; Perl (before version 6), PHP, and Maple (up to version 5) ~ ;; Perl 6 || ;; Standard SQL, PL/I, Rexx, and Maple (from version 6) <> ;; Mathematica .. ;; Lua , ;; J programming language ^ ;; OCaml and Standard ML
Unique variants
- Awk uses the empty string: two expressions adjacent to each other are concatenated. This is called Juxtaposition. Unix shells have a similar syntax. Rexx uses this syntax for concatenation including an intervening space.
- C allows juxtaposition for string literals, however, for strings stored as character arrays, the strcat function must be used.
- MATLAB and Octave use the syntax "[x y]" to concatenate x and y.
- Visual Basic 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.
String literals
This section compares styles for declaring a string literal.
Quoted raw
<![CDATA[ TheQuickBrownFox ]]> ;; CDATA section ;; XML
Quoted interpolated
This section needs expansion. You can help by adding to it. |
Dual quoting
This section needs expansion. You can help by adding to it. |
Multiple quoting
This section needs expansion. You can help by adding to it. |
Unique quoting variants
16HTheQuickBrownFox ;; Hollerith notation ;; Fortran (indented with whitespace) ;; Indented with whiteapce and newlines ;; YAML