Science Fair Projects Ideas - Concatenation

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Concatenation

(Redirected from Concatenate)

In formal language theory (and therefore in programming languages), 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, sting concatenation is usually accomplished by putting a concatenation operator between two strings (operands). The following statement assumes the language uses the "+" symbol as its concatenation operator:

print "Hello " + "World";

This code will print to the screen:

Hello World

Contents

Different languages

Different languages use different operators. Most languages use the "+" sign though several deviate from this norm:

  • Perl (pre version 6) uses the "." sign.
  • Perl 6 uses the "_" sign.
  • Visual Basic uses the "&" sign. It can also use the "+" sign but this can lead to problems if the two operands are numbers.

Interpolation

Some languages, notably Perl, can use a technique called interpolation that makes string concatenation easier. Instead of typing:

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

one could type:

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

$stringVar gets interpolated in the rest of the string. The Perl interpreter print Hello World instead of Hello $stringVar because it recognizes that $stringVar is a variable. It can do this because all scalar variables in Perl must begin with the "$" token where as most languages don't usually require variables to have special characters.

Other uses of concatenation

In a Unix shell, the cat command can be used to concatenates files. The output of this concatenation can be a new file which consist of the content of two or more other files. The cat command is normally used merely to print a file to the screen however.

Concatenation in mathematics

In mathematics, concatenation is the joining of two strings, that is, when a and b are concatenated, they form ab. Concatenation of two strings, a and b is denoted as ab or a||b.

10-26-2009 08:16:03
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice