String trimLeft() and trimRight()
The trimLeft() and trimRight() methods of strings return a new string with whitespace removed from the beginning or end of the string. They're aliases for trimStart() and trimEnd().
Browser support
- Chrome 4 Released on 2010-01-25
- Chrome Android 18 Released on 2012-06-27
- Edge 12 Released on 2015-07-29
- Firefox 3.5 Released on 2009-06-30
- Firefox for Android 4 Released on 2011-03-29
- Safari 5 Released on 2010-06-07
- Safari on iOS 4.2 Released on 2010-11-22
MDN documentation
Specifications
- ECMAScript® 2027 Language Specification (#String.prototype.trimleft), from TC39 (Ecma International).
View as JSON | Edit this feature | Report an issue | Web-features entry: source, dist