All Objects
String Object
METHOD: String::concat
object.
concat
(strName2, strName3....strName[n])
This method joins the text contained in one string with the text from other specified strings and returns a new string.
The following code combines the text contained in two specified strings and writes the concatenated string to the document.
Code:
myString1 = new String("This demonstrates the ")
myString2 = new String("concat method.")
document.write(myString1.concat(myString2))
Output:
This demonstrates the concat method.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information