Web features explorer

String trimStart() and trimEnd()

Widely available
Tags: javascript Groups: JavaScript > Primitive types > Strings

The trimStart() and trimEnd() methods of strings return a new string with whitespace removed from the beginning or end of the string. To learn more, see String.prototype.trimEnd(), String.prototype.trimStart() at MDN.

Compatibility

Specifications