icu_list
provides the [ListFormatter
] which renders sequences of Writeable
s as lists in a locale-sensitive way.
```rust use iculist::{ListFormatter, ListStyle}; use iculocid::locale; use writeable::Writeable;
let listformatter = ListFormatter::trynewand( locale!("es"), &icutestdata::get_provider(), ListStyle::Wide, ) .expect("Data should load successfully");
asserteq!( listformatter.format(["España", "Suiza"].iter()) .writetostring(), "España y Suiza" );
// The Spanish 'y' sometimes becomes an 'e': asserteq!( listformatter.format(["España", "Suiza", "Italia"].iter()) .writetostring(), "España, Suiza e Italia" );
// We can use any Writeables as inputs: asserteq!( listformatter.format(1..=10).writetostring(), "1, 2, 3, 4, 5, 6, 7, 8, 9 y 10" ); ```
For more information on development, authorship, contributing etc. please visit ICU4X home page
.