Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • String

Index

Methods

Methods

padEnd

  • padEnd(maxLength: number, fillString?: string): string
  • Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string.

    Parameters

    • maxLength: number

      The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is.

    • Optional fillString: string

      The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020).

    Returns string

padStart

  • padStart(maxLength: number, fillString?: string): string
  • Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length. The padding is applied from the start (left) of the current string.

    Parameters

    • maxLength: number

      The length of the resulting string once the current string has been padded. If this parameter is smaller than the current string's length, the current string will be returned as it is.

    • Optional fillString: string

      The string to pad the current string with. If this string is too long, it will be truncated and the left-most part will be applied. The default value for this parameter is " " (U+0020).

    Returns string

Generated using TypeDoc