Description
The trimLeft() method returns a string stripped of whitespace from both ends.
This method has the form:
string.trimLeft()
Note: This method does not change the value of the string itself.
Examples
The following example shows the basic use of this method.
<script>
var s = " Hello from JavaScript ";
document.write("'" + s.trimLeft() + "'");
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|
Version Information
This form was added in version: 1.8.1