Content deleted Content added
m spelling (WP:Typo Team) |
Aadirulez8 (talk | contribs) m v2.05 - Fix errors for CW project (Reference list missing / disambiguation page with disallowed <ref>) |
||
(19 intermediate revisions by 12 users not shown) | |||
Line 1:
{{ProgLangCompare}}
Line 8 ⟶ 7:
===Common variants===
{| class="wikitable"
|-
Line 15 ⟶ 13:
|-
| +
| [[ALGOL 68]], [[
|-
| ++
| [[
|-
| $+
| [[
|-
| &
| [[Ada (programming language)|Ada]], [[AppleScript]], [[COBOL]] (for literals only), [[Curl (programming language)|Curl]], [[
|-
| concatenate
| [[Common Lisp]]
|-
| .
|
|-
| ~
| [[
|-
| <nowiki>||</nowiki>
| [[Icon (programming language)|Icon]],
|-
| <>
| [[Mathematica]], [[Wolfram Language]], [[Elixir (programming language)|Elixir]]
|-
| ..
| [[Lua (programming language)|Lua]]
|-
| :
| [[Pick Basic]]
|-
| ,
| [[
|-
| ^
| [[
|-
| //
Line 62 ⟶ 60:
===Unique variants===
* [[
* [[C (programming language)|C]] (along with [[Python (programming language)|Python]] and [[Dart (programming language)|Dart]]<ref>{{Cite web |title=Built-in types |url=https://dart.dev/language/built-in-types/ |access-date=2025-07-22 |website=dart.dev |language=en}}</ref>) allows juxtaposition for string literals, however, for strings stored as [[Character (computing)|character]] [[Array data structure|arrays]], the <code>[[strcat]]</code> function must be used.
* [[COBOL]] uses the <code>STRING</code> statement to concatenate string variables.
* [[MATLAB]] and [[GNU Octave
* [[Visual Basic]] and [[Visual Basic .NET]] can also use the "<code>+</code>" sign but at the risk of ambiguity if a string representing a number and a number are together.
* [[Microsoft Excel]] allows both "<code>&</code>" and the function "<code>=CONCATENATE(X,Y)</code>".
Line 85 ⟶ 83:
|-
| <code>"Hello, $name!"</code>
| [[Bourne shell]], Dart, Perl, PHP, Windows PowerShell
|-
| <code>qq(Hello, $name!)</code>
Line 94 ⟶ 92:
|-
| <code>"Hello, #{name}!"</code>
| CoffeeScript, Ruby, [[Elixir (programming language)|Elixir]]
|-
| <code>%Q(Hello, #{name}!)</code>
| Ruby (alternate)
|-
| <code>(format
|[[Common Lisp]]
|-
| <code>`Hello, ${name}!`</code>
Line 121 ⟶ 119:
|-
| <code>"I said \"Hello, world!\""</code>
| C, C++, C#, D, Dart, F#, Java, JavaScript, Mathematica, Ocaml, Perl, PHP, Python, Rust, Swift, Wolfram Language, Ya
|-
| {{nowrap|<code><nowiki>'I said \'Hello, world!\''</nowiki></code>}}
| CoffeeScript, Dart (alternate), JavaScript (alternate), Python (alternate)
|-
| <code>"I said `"Hello, world!`""</code>
Line 141 ⟶ 139:
| FreeBASIC
|-
| {{nowrap|<code>r#"I said "Hello, world!""#</code>}}
|Rust (alternate)
|-
| {{nowrap|<code>R"("I said "Hello, world!")"</code>}}
|C++ (alternate)
|}
Line 154 ⟶ 155:
|-
| <code>"I said ""Hello, world!"""</code>
| Ada, ALGOL 68, COBOL, Excel, Fortran, FreeBASIC, Visual Basic (.NET)
|-
| <code><nowiki>'I said ''Hello, world!'''</nowiki></code>
|
|}
Line 169 ⟶ 170:
|-
| <code>'Hello, world!'</code>
| APL, Bourne shell, Fortran, Object Pascal, Pascal, Perl, PHP, Pick Basic, Ruby, Smalltalk, Windows PowerShell
|-
| <code>q(Hello, world!)</code>
Line 184 ⟶ 185:
|-
| <code>r"Hello, world!"</code>
| Cobra, D, Dart, Python, Rust
|-
| <code>r'Hello, world!'</code>
| Dart (alternate)
|-
| <code>"Hello, world!"</code>
Line 205 ⟶ 209:
|-
! Syntax
! Here
! Language(s)
|-
Line 212 ⟶ 216:
and so little time to say them
EOF</pre>
| {{Yes}}
| Bourne shell, Perl
|-
| <pre><<<EOF
Line 219 ⟶ 223:
and so little time to say them
EOF</pre>
| {{Yes}}
| PHP
|-
Line 226 ⟶ 230:
and so little time to say them
"@</pre>
| {{No}}
| Windows Powershell
|-
Line 233 ⟶ 237:
and so little time to say them
]"</pre>
| {{No}}
| Eiffel
|-
Line 240 ⟶ 244:
and so little time to say them
"""</pre>
| {{No}}
| CoffeeScript,
|-
|<pre>"
Line 247 ⟶ 251:
and so little time to say them
"</pre>
| {{No}}
|
|-
| <pre>R"(
I have a lot of things to say
and so little time to say them
)"
</pre>
| {{No}}
| C++
|-
| <pre>r"
Line 254 ⟶ 266:
and so little time to say them
"</pre>
| {{No}}
| Rust
|-
Line 261 ⟶ 273:
and so little time to say them
]]</pre>
| {{No}}
| Lua
|-
Line 268 ⟶ 280:
and so little time to say them
`</pre>
| {{No}}
| JavaScript (ECMAScript 6)
|}
Line 292 ⟶ 304:
:1. {{note|es6rawstr}} <code>String.raw``</code> still processes string interpolation.
==
{{Reflist}}
:1. {{note|es6rawstr}} https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw
|