cleanAddress関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Tidies an address typed in a hurry: spaces, commas, letter case, the street type and the state, without changing what it says.
インポート
import { cleanAddress } from "@johnmorrisdotca/address-plus";
定義
function cleanAddress(addressString: string, options?: CleanAddressOptions): string
引数
| 名前 | 型 | 説明 |
|---|---|---|
addressString | string | The address as typed. |
options (省略可) | CleanAddressOptions | What to tidy and the letter case to set (see |
戻り値
string
The tidied address; the input, trimmed, when it cannot be parsed.
例
import { cleanAddress } from "@johnmorrisdotca/address-plus";
console.log(cleanAddress("350 FIFTH AVENUE, NEW YORK, NY 10118"));
// → "350 Fifth Ave, New York NY 10118"350 Fifth Ave, New York NY 10118出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。