Skip to main content
Version: Next

Pad Start Of String

Pads the current string from the start with a given string and returns a new string of the provided length

Description

Method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length. The padding is applied from the start of the current string.

Uses the padStart JavaScript function.

See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String" target="_blank">string object</a>.

Inputs

  • s (String): String to pad.
  • length (Number): Output string length.
  • pad string (String): The string used as padding

Outputs

  • padded string (String): Padded string.