Staging copy. The live site is highearthorbit.com.

Sep 12, 2005 · Programming

Concatenating Strings - a review

As I mentioned, I'm learning/employing a bunch of varied programming languages. In fact, I'm employing several programming languages within a single project. While tabbing betwixt editor windows I'll often miss tabbing between programming languages. Fortunately, error codes are as they are and they yell at me promptly.

To review, concatenating strings:

Javascript


var mystring = string1 + " is " + string2;

Ruby and Python


mystring = string1 + " is " + string2;

PHP


$mystring = $string1." is ".$string2;

C

char mystring[50], string1[10], string2[10];

strcat(mystring, string1);
strcat(mystring, " is ");
strcat(mystring, string2);

C++

string mystring, string1,string2;
mystring = string1 + " is " + string2;

Feel free to add any more you know.

Programming