Skip to main content
Version: Next

Pad End Of String

Pads the current string from the end 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 end of the current string.

Uses the padEnd 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.