JavaScript文字列trimStart
trimEnd

trimStart文字列

at

先頭の空白を削除します。

構文

str.trimStart()

使用例

下記の値を入力するとサンプルに即時反映されます。

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