邮政编码生成器
生成指定数据地区格式的邮政编码,可用于验证长度、前导零和连字符。
location.zipCode
生成设置
生成后在这里查看结果。
参数 & 示例
生成指定数据地区格式的邮政编码,可用于验证长度、前导零和连字符。
location.zipCode(options?: string | { state?: string; format?: string; })- options
- The format used to generate the zip code or an options object.
- options.state
- The state to generate the zip code for. If the current locale does not have a corresponding postcode_by_state definition, an error is thrown.
- options.format
- The optional format used to generate the zip code. By default, a random format is used from the locale zip formats. This won't be used if the state option is specified.
示例
"16064-3811"请在测试环境使用合成数据。