[Edge]。→、
言語を考慮したリストの書式化を可能にする Intl.ListFormat オブジェクトを生成して返します。
| locales | 省略可。 言語コードの文字列、またはそのような文字列の配列。→Intl:locales
省略した場合は、¶システムのロケール? | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| options | 省略可。以下のプロパティを 1 つ以上持つオブジェクト。
|
Lst=["Cat", "Dog", "Panda"];
DA=new Intl.ListFormat('ja'); //日本語。
D=DA.format(Lst); //=[string]:Cat、Dog、Panda
DA=new Intl.ListFormat('en'); //英語。
D=DA.format(Lst); //=[string]:Cat, Dog, and Panda
DA=new Intl.ListFormat('en', {type:'disjunction'}); //英語、リスト化の種類。
D=DA.format(Lst); //=[string]:Cat, Dog, or Panda
DA=new Intl.ListFormat('ja', {type:'disjunction'}); //日本語、リスト化の種類。
D=DA.format(Lst); //=[string]:Cat、Dog、またはPanda
DA=new Intl.ListFormat('ja', {type:'conjunction'}); //日本語、リスト化の種類。
D=DA.format(Lst); //=[string]:Cat、Dog、Panda
DA=new Intl.ListFormat('ja', {style:'short'}); //日本語、リスト化のスタイル。
D=DA.format(Lst); //=[string]:Cat、Dog、Panda
DA=new Intl.ListFormat('ja', {style:'narrow'}); //日本語、リスト化のスタイル。
D=DA.format(Lst); //=[string]:Cat、Dog、Panda