Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017年4月.
padStart() は String 値のメソッドで、指定された文字列でこの文字列をパディングし(必要に応じて繰り返したり切り捨てたりして)、結果の文字列が指定された長さを示すようにします。パディングは、この文字列の先頭から適用されます。
現在の文字列の延長後に返される文字列の長さです。この値が現在の文字列の長さよりも短い場合、文字列がそのまま返されます。
padString 省略可現在の文字列を延長するための文字列です。 padString が targetLength より長い場合は、右からその長さ分が切り捨てられます。 この引数の既定値は、空白文字 (U+0020) です。
現在の文字列の先頭に padString が適用された、指定された targetLength の長さの文字列です。
| ECMAScript® 2027 Language Specification # sec-string.prototype.padstart |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年8月22日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.