Function strpad

  • create padded string with specified length and padding string

    Parameters

    • s: string

      input string

    • len: number

      output string length

    • Optional defpadchar: string

      padding character (default is "0")

    Returns string

    padded string

    Example

    strpad("1234", 10, "0") -> "0000001234"
    strpad("1234", 10, " ") -> " 1234"
    strpad("1234", 10) -> "0000001234"