icu_pattern

Crates.ioicu_pattern
lib.rsicu_pattern
version0.4.0
created_at2021-04-29 18:14:41.646151+00
updated_at2025-02-26 18:31:56.501534+00
descriptionICU pattern utilities
homepage
repositoryhttps://github.com/unicode-org/icu4x
max_upload_size
id391171
size132,996
icu4x-release (github:unicode-org:icu4x-release)

documentation

README

icu_pattern crates.io

icu_pattern is a utility crate of the ICU4X project.

It includes a [Pattern] type which supports patterns with various storage backends.

The types are tightly coupled with the [writeable] crate.

Examples

Parsing and interpolating with a single-placeholder pattern:

use icu_pattern::SinglePlaceholderPattern;
use writeable::assert_writeable_eq;

// Parse a pattern string:
let pattern = SinglePlaceholderPattern::try_from_str(
    "Hello, {0}!",
    Default::default(),
)
.unwrap();

// Interpolate into the pattern string:
assert_writeable_eq!(pattern.interpolate(["World"]), "Hello, World!");

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

Commit count: 4409

cargo fmt