Citizendia
Your Ad Here

This article is part of the
Programming Language Comparison
series. Programming languages are used for controlling the behavior of a machine (often a Computer)
General Comparison
Basic Syntax
Basic Instructions
Arrays
Associative arrays
String Operations
String Functions
Object-oriented programming
Database access

Evaluation strategy
List of "hello world" programs

Comparison of ALGOL 68 and C++
Compatibility of C and C++
Comparison of C and Pascal
Comparison of C++ and Java
Comparison of C# and Java
Comparison of C# and Visual Basic .NET
Comparison of ABAP and Java
This box: view  talk  edit

In computer programming, concatenation is the operation of joining two character strings end to end. In Computer programming and some branches of Mathematics, a string is an ordered Sequence of Symbols. For example, the strings "foo" and "bar" may be concatenated to give "foobar". The term foobar is a common Placeholder name, also referred to as Metasyntactic variable, used in Computer programming or computer-related documentation In programming languages, string concatenation is a binary operation usually accomplished by putting a concatenation operator between two strings (operands). A programming language is an Artificial language that can be used to write programs which control the behavior of a machine particularly a Computer. In Mathematics, a binary operation is a calculation involving two Operands, in other words an operation whose Arity is two Programming languages generally support a set of operators that are similar to operators in mathematics. In Mathematics, an operand is one of the inputs (arguments of an Operator.

For example, the following expression uses the "+" symbol as the concatenation operator:

print "Hello " + "World";

which produces the output:

   Hello World

Contents

Different languages

Different languages use different operators. An expression in a Programming language is a combination of values Variables operators and functions that are interpreted ( Concatenation Different languages use different symbols for the concatenation operator Most languages use the "+" sign though several deviate from this norm.

Examples

   +       ;; ActionScript, BASIC, C++, C#, Java, JavaScript, Pascal, Python, Ruby, Windows PowerShell, SQL
   &       ;; Ada, AppleScript, VHDL, Visual Basic 
   . ActionScript is a scripting language based on ECMAScript. ActionScript is used primarily for the development of websites and software using the Adobe Flash Player In Computer programming, BASIC (an Acronym for Beginner's All-purpose Symbolic Instruction Code) is a family of High-level programming languages  C++ (" C Plus Plus " ˌsiːˌplʌsˈplʌs is a general-purpose Programming language. C# (pronounced C Sharp is a Multi-paradigm JavaScript is a Scripting language most often used for Client-side web development Pascal is an influential imperative and procedural Programming language, designed in 1968/9 and published in 1970 by Niklaus Wirth as a small Python is a general-purpose High-level programming language. Its design philosophy emphasizes programmer productivity and code readability Ruby is a dynamic, reflective, general purpose Object-oriented programming language that combines syntax inspired by Perl with Smalltalk Windows PowerShell is an extensible command-line shell and associated Scripting language from Microsoft  Ada is a structured, Statically typed, imperative, and object-oriented high-level computer Programming language AppleScript is a Scripting language devised by Apple Inc, and built into Mac OS. Visual Basic ( VB) is the third-generation event-driven programming language and associated development environment (IDE from        ;; Perl (before version 6), PHP
   ||      ;; REXX, SQL

For a more detailed comparison, please see the concatenation comparison article. NOTES FOR EDITORS "Perl" is not an acronym (read the "Name" section below PHP is a computer Scripting language. Originally designed for producing Dynamic web pages it has evolved to include a Command line interface capability REXX (REstructured eXtended eXecutor is an interpreted Programming language which was developed at IBM. Concatenation Different languages use different symbols for the concatenation operator

Programming conventions

Assignment

Many languages, such as PHP and JavaScript have a variant of the assignment operator that allows concatenation and assignment to a variable in one statement. PHP is a computer Scripting language. Originally designed for producing Dynamic web pages it has evolved to include a Command line interface capability JavaScript is a Scripting language most often used for Client-side web development In Computer science the assignment statement sets or re-sets the value stored in the storage location(s denoted by a Variable Name.

For example, in PHP and Perl:

//Example 1 (concatenation operator ". ")
$var = "Hello ";
$var = $var .  "World";
 
//Example 2 (combined assignment and concatenation ". =")
$var = "Hello ";
$var . = "World";

Both examples produce the same result.

Interpolation

Some languages, (such as Perl, PHP, and most Unix shells), support variable interpolation as an alternative form of string concatenation. NOTES FOR EDITORS "Perl" is not an acronym (read the "Name" section below PHP is a computer Scripting language. Originally designed for producing Dynamic web pages it has evolved to include a Command line interface capability A Unix shell, is a command line shell that provides the traditional User interface for the Unix Operating system and for Unix-like A variable (ˈvɛərɪəbl is an Attribute of a physical or an abstract System which may change its Value while it is under Observation.

For example, in Perl, the concatenation syntax:

my $stringVar;
$stringVar = "World"; 
print "Hello " .  $stringVar;

can be substituted with the string literal syntax:

my $stringVar; 
$stringVar = "World";
print "Hello $stringVar";

since double quoted string literals in Perl indicate scalar variables with the sigil ($) character. A string literal is the representation of a string value within the Source code of a Computer program. A string literal is the representation of a string value within the Source code of a Computer program. In Computer programming, a sigil (pronounced /'sɪdʒɪl/ or /'sɪg

See also

External links

A formal language is a set of words, ie finite strings of letters, or symbols.

Dictionary

concatenation

-noun

  1. (countable or uncountable) A series of links united; a series or order of things depending on each other, as if linked together; a chain, a succession.
© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic