Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Concatenation
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Syntax== In many [[programming language]]s, string concatenation is a [[binary operation|binary]] [[infix operator]], and in some it is written without an operator. This is implemented in different ways: * [[operator overloading|Overloading]] the plus sign <code>+</code> Example from C#: <code>"Hello, " + "World"</code> has the value <code>"Hello, World"</code>. * Dedicated operator, such as <code>.</code> in PHP, <code>&</code> in Visual Basic<ref>{{cite web |url=http://msdn.microsoft.com/en-us/library/te2585xw.aspx |title=Concatenation Operators in Visual Basic |work=.NET Visual Basic guide Language features: Operators and expressions |date=2015 |publisher=Microsoft}}</ref>, and <code>||</code> in SQL.<ref>{{cite web |title=SQL {{!}} Concatenation Operator |url=https://www.geeksforgeeks.org/sql-concatenation-operator/ |website=geeksforgeeks.org |date=12 January 2018 |access-date=11 August 2023}}</ref><ref>{{cite web |url=http://docs.oracle.com/cd/B19306_01/server.102/b14200/operators003.htm |title=Concatenation Operator |work=Oracle Database Online Documentation, 10g Release 2 (10.2) / Administration: Database SQL Reference |publisher=Oracle}}</ref> This has the advantage over reusing <code>+</code> that it allows implicit [[type conversion]] to string. * [[string literal concatenation]], which means that adjacent strings are concatenated without any operator. Example from C: <code>"Hello, " "World"</code> has the value <code>"Hello, World"</code>. In many scientific publications or standards the concatenation operator notation used is <code>||</code>.<ref>{{Cite report |url=https://datatracker.ietf.org/doc/html/rfc8017#section-2 |title=PKCS #1: RSA Cryptography Specifications Version 2.2 |last=Moriarty |first=Kathleen |last2=Kaliski |first2=Burt |last3=Jonsson |first3=Jakob |last4=Rusch |first4=Aneas |date=November 2016|section=2. Notation |publisher=Internet Engineering Task Force |issue=RFC 8017}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)