toString Method (String)

Returns a string representation of a string.

string.toString()

string

Required. The array to represent as a string.

The string representation of the string.

The following example illustrates the use of the toString method with a string.

var string = "this is a test";
var strStr = string.toString();
document.write(strStr);

// Output: this is a test

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.

Show:
© 2014 Microsoft