getProvinceFromPostalCode関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The province or territory a Canadian postal code is in, from its first letter, and for the X codes of the north, its first three characters.
インポート
import { getProvinceFromPostalCode } from "@johnmorrisdotca/address-plus";
定義
function getProvinceFromPostalCode(postalCode: string): string | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
postalCode | string | The postal code, with or without its space. |
戻り値
string | null
The two-letter code, or null for a code that is not Canadian.
例
import { getProvinceFromPostalCode } from "@johnmorrisdotca/address-plus";
console.log(getProvinceFromPostalCode("H3G 1P1"));
// → "QC"QC出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。