JavaScriptStringtrimStart
trimEnd

trimStartString

at

Removes whitespace from the beginning of a string.

Syntax

str.trimStart()

Example

Enter values below to update the example in real time.

const
console
trimStart
const text = "  hello world  ";
console.log(text.trimStart());   // "hello world  "