Comparison of programming languages (strings)

This is an old revision of this page, as edited by Elonka (talk | contribs) at 06:37, 3 November 2006 (Tagging as uncategorized using AWB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Concatenation

Common variants:

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