JS: String.prototype.trimStart

By Xah Lee. Date: . Last updated: .

(new in ECMAScript 2019)

str.trimStart()

same as str.trimLeft()

str.trimLeft()

Return a new string with whitespaces on the left removed.

console.assert("  t".trimStart() === "t");
console.assert("  t".trimLeft() === "t");