Tweakr
    Preparing search index...

    Function padRight

    • Pads a string on the right to reach the specified length.

      Parameters

      • str: string

        The string to pad.

      • length: number

        The desired total length of the string after padding.

      • char: string = " "

        The character to use for padding. Defaults to a space.

      Returns string

      The padded string.

      1.1.0

      padRight("5", 3); // "5  "
      padRight("42", 5, "0"); // "42000"