-
Sub-task
-
Resolution: Delivered
-
P4
-
22
-
generic
-
generic
A new class, `ListFormat`, which processes the locale-dependent list patterns has been introduced, based on [Unicode Consortium's LDML specification](https://www.unicode.org/reports/tr35/tr35-general.html#ListPatterns). For example, a list of three `String`s: "Foo", "Bar", "Baz" is typically formatted as "Foo, Bar, and Baz" in US English, while in French it is "Foo, Bar et Baz." The following code snippet does such formatting:
```
ListFormat.getInstance().format(List.of("Foo", "Bar", "Baz"))
```
Besides the default concatenation type `STANDARD` (= and), the class provides two additional types, `OR` for "or" concatenation, and `UNIT` for concatenation suitable for units for the locale.
```
ListFormat.getInstance().format(List.of("Foo", "Bar", "Baz"))
```
Besides the default concatenation type `STANDARD` (= and), the class provides two additional types, `OR` for "or" concatenation, and `UNIT` for concatenation suitable for units for the locale.