Pad String Start

Pad a string from the start with a specified character to reach a target length.

Code

General
str.padStart(length, char);

Parameters

The string to pad

Target length of the result

Character to pad with

Browser·fetch() may be limited by CORS

More JavaScript Snippets