August 1999
Intermediate to advanced
1488 pages
72h 53m
English
string.concat(string2)
The concat() method of an instance of the String object concatenates the string in string2 to the end of string to return a new string.
Listing 6.235 creates two instances of the String object and uses the concat() method to concatenate them to create a new string. The string is then displayed in an alert box.
<script language="JavaScript1.2"> <!–– Hide // Create 2 instances of the String object and concatenate // them together. var myString1 = new String("Hello, "); var myString2 = new String("World!"); var myConcatString = myString1.concat(myString2); // ... |
Read now
Unlock full access