Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

string


The string function converts the given argument to a string.

Syntax

string( [object] )

Arguments

object (optional)
The object to convert to a string. If omitted, the context node is used.

Returns

A string

Notes

  • If the object is a node-set, the string value of the first node in the set is returned.
  • A number is converted as follows:
    • NaN is converted to the string NaN.
    • Positive zero is converted to the string 0.
    • Negative zero is converted to the string 0.
    • Positive infinity is converted to the string Infinity.
    • Negative infinity is converted to the string -Infinity.
    • Decimal numbers between -1 and 1 are converted to a string with a single leading 0 before the decimal point.

Defined

XPath 1.0 4.2

Gecko support

Supported.

Document Tags and Contributors

 Contributors to this page: Sheppy, Mgjbot, Ptak82, Jonnyq
 Last updated by: Sheppy,