JavaScript

Intl.Locale.prototype.toString() メソッド


編集:2023.01.10 by T.A.

[Edge]。→

Intl.Locale での計算されたロケール識別子を文字列で返します。

構文
Intl.Locale.toString()
Intl.Locale Intl.Locale
戻り値

文字列

DA=new Intl.Locale('ja-JP');  //日本語の日本国。
D=DA.toString();  //=[string]:ja-JP
DA=new Intl.Locale('ja');  //日本語の日本国。
D=DA.toString();  //=[string]:ja
DA=new Intl.Locale('ja', {numeric:true, caseFirst:'upper', ignorePunctuation:true});  //日本語、数字を数値、大文字が先、句読点無視。
	//(ignorePunctuation は Locale()の仕様外。)
D=DA.toString();  //=[string]:ja-u-kf-upper-kn

Intl.Locale()言語タグ


テスト