mozilla

Compare Revisions

String.prototype.trim()

Change Revisions

Revision 43458:

Revision 43458 by Nesk on

Revision 43459:

Revision 43459 by Nesk on

Title:
Trim
Trim
Slug:
JavaScript/Reference/Global_Objects/String/Trim
JavaScript/Reference/Global_Objects/String/Trim
Tags:
"String Methods"
"String Methods"
Content:

Revision 43458
Revision 43459
n10    <h3 name="Summary">n10    <h2 name="Summary">
n12    </h3>n12    </h2>
n43    <h3 name="Syntax">n43    <h2 name="Syntax">
nn45    </h2>
46    <p>
47      <code><em>string</em>.trim()</code>
48    </p>
49    <h2 name="Parameters">
50      Parameters
51    </h2>
52    <p>
53      None.
54    </p>
55    <h2 name="Description">
56      Description
57    </h2>
58    <p>
59      The <code>trim</code> method returns the string stripped of
 > whitespace from both ends. <code>trim</code> does not affect the
 > value of the string itself.
60    </p>
61    <h2 name="Examples">
62      Examples
63    </h2>
64    <h3 name="Example:_Using_toLowerCase">
65      Example: Using <code>trim</code>
n47      <code><em>string</em>.trim()</code>n
48    </p>
49    <h3 name="Parameters">
50      Parameters
51    </h3>
52    <p>
53      None.
54    </p>
55    <h3 name="Description">
56      Description
57    </h3>
58    <p>
59      The <code>trim</code> method returns the string stripped of
> whitespace from both ends. <code>trim</code> does not affect the 
> value of the string itself. 
60    </p>
61    <h3 name="Examples">
62      Examples
63    </h3>
64    <h4 name="Example:_Using_toLowerCase">
65      Example: Using <code>trim</code>
66    </h4>
67    <p>
n70    <pre>n70    <pre class="script-jem">
71var orig="   foo  "71var orig = "   foo  ";
72document.write(orig.trim())72alert(orig.trim());
73 
n74    <h3 name="See_Also">n75    <h2 name="See_Also">
n76    </h3>n77    </h2>
n85    <h3 name="See_also">n86    <h2 name="See_also">
n87    </h3>n88    </h2>
n91    <pre class="deki-transform">n92    <pre class="script-jem">
nn98 
n98    <h3>n100    <h2>
t100    </h3>t102    </h2>

Back to History