@tremendous/help
    Preparing search index...

    Function trimPostalCode

    • Normalizes a postal code to a 5-digit format.

      Parameters

      • postalCode: string

        The postal code to normalize.

      • maxLength: number = 5

        The maximum length of the postal code.

      Returns string

      The normalized postal code.

      trimPostalCode("10001-1234"); // "10001"
      trimPostalCode("10001-1234", 9); // "10001-1234"