File: README.md

package info (click to toggle)
rust-coreutils 0.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 505,620 kB
  • sloc: ansic: 103,594; asm: 28,570; sh: 8,910; python: 5,581; makefile: 472; cpp: 97; javascript: 72
file content (37 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# icu_pattern [![crates.io](https://img.shields.io/crates/v/icu_pattern)](https://crates.io/crates/icu_pattern)

<!-- cargo-rdme start -->

`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:

```rust
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!");
```

[`ICU4X`]: ../icu/index.html
[`FromStr`]: core::str::FromStr

<!-- cargo-rdme end -->

## More Information

For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x).