Revision 43468 of String.prototype.trimLeft()

  • Revision slug: JavaScript/Reference/Global_Objects/String/TrimLeft
  • Revision title: trimLeft
  • Revision id: 43468
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment no wording changes

Revision Content

{{ Non-standard_header() }}

Summary

Removes whitespace from the left end of the string.

Method of String
Implemented in: JavaScript 1.9.1

Syntax

trimLeft()

Parameters

None.

Description

The trimLeft method returns the string stripped of whitespace from its left end. trimLeft does not affect the value of the string itself.

Examples

Example: Using trimLeft

The following example displays the lowercase string "foo  ":

var orig="   foo  "
document.write(orig.trimLeft())

See Also

Revision Source

<p>{{ Non-standard_header() }}</p>
<h3 name="Summary">Summary</h3>
<p>Removes whitespace from the left end of the string.</p>
<table class="fullwidth-table"> <tbody> <tr> <td class="header" colspan="2">Method of <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/String" title="en/Core_JavaScript_1.5_Reference/Global_Objects/String">String</a></td> </tr> <tr> <td>Implemented in:</td> <td>JavaScript 1.9.1</td> </tr> </tbody>
</table>
<h3 name="Syntax">Syntax</h3>
<p><code> trimLeft() </code></p>
<h3 name="Parameters">Parameters</h3>
<p>None.</p>
<h3 name="Description">Description</h3>
<p>The <code>trimLeft</code> method returns the string stripped of whitespace from its left end. <code>trimLeft</code> does not affect the value of the string itself.</p>
<h3 name="Examples">Examples</h3>
<h4 name="Example:_Using_toLowerCase">Example: Using <code>trimLeft</code></h4>
<p>The following example displays the lowercase string "foo  ":</p>
<pre>var orig="   foo  "
document.write(orig.trimLeft())
</pre>
<h3 name="See_Also">See Also</h3>
<ul> <li><a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/String/trim" title="en/Core JavaScript 1.5 Reference/Global Objects/String/trim"><code>trim()</code></a> </li> <li><a class="internal" href="/en/Core_JavaScript_1.5_Reference/Global_Objects/String/trimRight" title="en/Core JavaScript 1.5 Reference/Global Objects/String/trimRight"><code>trimRight()</code></a> </li>
</ul>
Revert to this revision