FACTOID # 87: 22% of American women aged 20 gave birth while in their teens. In Switzerland and Japan, only 2% did so.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RELATED ARTICLES
People who viewed "Concatenation" also viewed:
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Concatenation

In computer programming, concatenation is the operation of joining two character strings end to end. For example, the strings "foo" and "bar" may be concatenated to give "foobar". In programming languages, string concatenation is a binary operation usually accomplished by putting a concatenation operator between two strings (operands). Concatenation may refer to: Concatenation, a computer programming operation that joins strings together Concatenation (mathematics), a mathematical operation that combines two vectors Concatenated SMS, a way of combining multiple SMS text messages sent to cellular phones Cat (Unix), a Unix command to write the contents of one or more files... Programming redirects here. ... In various branches of mathematics and computer science, strings are sequences of various simple objects (symbols, tokens, characters, etc. ... For other uses, see Foobar (disambiguation). ... A programming language is an artificial language that can be used to control the behavior of a machine, particularly a computer. ... In mathematics, a binary operation is a calculation involving two input quantities, in other words, an operation whose arity is two. ... Programming languages generally have a set of operators that are similar to operators in mathematics: they are somehow special functions. ... In mathematics, an operand is one of the inputs (arguments) of an operator. ...



Normal concatenation, regarding programming For example, the following expression uses the "+" symbol as the concatenation operator: An expression in a programming language is a combination of values and functions or procedures, interpreted according to the particular rules of precedence and of association for a particular programming language, which computes and then returns another value. ...

  print "Tony " + "Akta";  

which produces the output:

 Hello World 

Contents

Different languages

Different languages use different operators. Most languages use the "+" sign though several deviate from this norm. // Different languages use different symbols for the concatenation operator. ...


Examples

 + ;; BASIC, C++, Pascal, JavaScript, Java, Python, Ruby, C#, ActionScript & ;; Ada, AppleScript, VHDL, Visual Basic . ;; Perl (before version 6), PHP, and Maple (up to version 5) 

For a more detailed comparison, please see the concatenation comparison article. BASIC (Beginners All-purpose Symbolic Instruction Code) is a family of high-level programming languages. ... C++ (pronounced see plus plus, IPA: ) is a general-purpose programming language with high-level and low-level capabilities. ... Pascal is an imperative computer programming language, developed in 1970 by Niklaus Wirth as a language particularly suitable for structured programming. ... JavaScript is a scripting language most often used for client-side web development. ... Java language redirects here. ... Python is a high-level programming language first released by Guido van Rossum in 1991. ... Ruby is a reflective, object-oriented programming language. ... The title given to this article is incorrect due to technical limitations. ... ActionScript is a scripting language based on ECMAScript, used primarily for the development of websites and software using the Adobe Flash Player platform (in the form of SWF files embedded into Web pages). ... Ada is a structured, statically typed, imperative, and object-oriented high-level computer programming language. ... AppleScript is a scripting language devised by Apple, Inc. ... VHDL, or VHSIC Hardware Description Language, is commonly used as a design-entry language for field-programmable gate arrays and application-specific integrated circuits in electronic design automation of digital circuits. ... This article is about the Visual Basic language shipping with Microsoft Visual Studio 6. ... Wikibooks has a book on the topic of Perl Programming Perl is a dynamic programming language created by Larry Wall and first released in 1987. ... For other uses, see PHP (disambiguation). ... Maple 9. ... // 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. For other uses, see PHP (disambiguation). ... JavaScript is a scripting language most often used for client-side web development. ... This article does not cite any references or sources. ...


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. Wikibooks has a book on the topic of Perl Programming Perl is a dynamic programming language created by Larry Wall and first released in 1987. ... For other uses, see PHP (disambiguation). ... Screenshot of a sample Bash session, taken on Gentoo Linux. ... In computer science and mathematics, a variable (pronounced ) (sometimes called an object or identifier in computer science) is a symbolic representation used to denote a quantity or expression. ...


For example, in Perl, the concatenation syntax:

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

can be substituted with the string literal syntax: A string literal is the representation of a string value within the source code of a computer program. ...

  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. ... In computer programming, a sigil is a symbol attached to a variable name, showing the variables datatype. ...


See also

In mathematics, logic, and computer science, a formal language is a language that is defined by precise mathematical or machine processable formulas. ...

External links

  • Concatenation of languages (different from concatenation on strings)

  Results from FactBites:
 
Dr. Dobb's | Fast, Nonintrusive String Concatenation | May 1, 2004 (3460 words)
Before conducting the tests, my expectation was that using the concatenator for sequences of one or two concatenations would actually result in a performance hit, with only longer sequences feeling the benefit of the optimization.
Though the data points for 16 and 32 concatenations are merely academic—if you're writing code with 32 concatenations, you probably need to take a holiday—the savings to be had for up to, say, 8 concatenations are considerable, up to 80 percent.
The concatenation operators of extant string classes can be "upgraded" simply and safely by replacing the existing operators with equivalent versions incorporating the concatenator.
Concatenation - Wikipedia, the free encyclopedia (578 words)
Concatenation is a standard operation in computer programming languages (a subset of formal language theory).
In programming languages, string concatenation is a binary operation usually accomplished by putting a concatenation operator between two strings (operands).
Concatenation of two strings, a and b is denoted as ab or ab.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.