getPrefectureFromJapanesePostalCode関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The prefecture a Japanese postal code delivers to, from Japan Post's data: by its first three digits, and for the codes on the far side of a prefix that straddles a border, by the whole code.
インポート
import { getPrefectureFromJapanesePostalCode } from "@johnmorrisdotca/address-plus/jp";
ほかのエクスポート元: @johnmorrisdotca/address-plus
定義
function getPrefectureFromJapanesePostalCode(postalCode: string): string | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
postalCode | string | The seven-digit code, with or without its hyphen, in either width. |
戻り値
string | null
The prefecture's JIS code, or null for a malformed code or one no Japanese code begins like.
例
import { getPrefectureFromJapanesePostalCode } from "@johnmorrisdotca/address-plus/jp";
console.log(getPrefectureFromJapanesePostalCode("530-0001"));
// → "27"27出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。