Table of contents
- 1. Summary
- 2. Syntax
- 3. Parameters
- 4. Description
- 5. Examples
- 6. See Also
Summary
Removes whitespace from the right end of the string.
Method of String | |
|---|---|
| Implemented in | JavaScript 1.8.1 |
| ECMAScript Edition | None |
Syntax
string.trimRight()
Parameters
None.
Description
The trimRight method returns the string stripped of whitespace from its right end. trimRight does not affect the value of the string itself.
Examples
Example: Using trimRight
The following example displays the lowercase string " foo":
var orig=" foo " document.write(orig.trimRight())
See Also
trim()trimRight()