ZipCodeValidator

object ZipCodeValidator

Contains helper methods to verify validity of zip codes. A valid zip code is either 5 or 9 digits. The first 5 digits must be between "00501" and "99999", inclusive. For 5+4 digit zip codes, there must be a hyphen between the 5 and 4 digits, e.g. 99999-9999. Note that leading zeros are required for zip codes below "10000".

Functions

isValid
Link copied to clipboard
fun isValid(zipCode: String): Boolean
Checks a given zip code for validity.

Properties

ZIP_CODE_VALIDATION_REGEX
Link copied to clipboard
val ZIP_CODE_VALIDATION_REGEX: <ERROR CLASS>
The Regex used by the SDK to validate zip codes.