#string #ascii #starts-with #ends-with #caseless

无 std str-utils

此包提供了一些特质,用于扩展实现了 AsRef<[u8]>AsRef<str>

8 个版本

0.1.7 2023 年 9 月 11 日
0.1.6 2022 年 3 月 19 日
0.1.5 2021 年 5 月 5 日
0.1.4 2021 年 4 月 22 日
0.1.2 2020 年 7 月 29 日

#465文本处理

Download history · Rust 包仓库 268/week @ 2024-03-25 · Rust 包仓库 279/week @ 2024-04-01 · Rust 包仓库 183/week @ 2024-04-08 · Rust 包仓库 112/week @ 2024-04-15 · Rust 包仓库 251/week @ 2024-04-22 · Rust 包仓库 124/week @ 2024-04-29 · Rust 包仓库 123/week @ 2024-05-06 · Rust 包仓库 271/week @ 2024-05-13 · Rust 包仓库 369/week @ 2024-05-20 · Rust 包仓库 205/week @ 2024-05-27 · Rust 包仓库 365/week @ 2024-06-03 · Rust 包仓库 169/week @ 2024-06-10 · Rust 包仓库 171/week @ 2024-06-17 · Rust 包仓库 243/week @ 2024-06-24 · Rust 包仓库 186/week @ 2024-07-01 · Rust 包仓库 129/week @ 2024-07-08 · Rust 包仓库

743 每月下载量
7 包中使用(5 个直接使用)

MIT 许可证

27KB
523

str Utils

CI

此包提供了一些特质,用于扩展实现了 AsRef<[u8]>AsRef<str>.

示例

use str_utils::*;

assert_eq!(true, "foobar".starts_with_ignore_ascii_case("FoO"));
assert_eq!(Some(1), "photo.jpg".ends_with_ignore_ascii_case_multiple(&[".png", ".jpg", ".gif"]));
assert_eq!(true, "http".eq_ignore_ascii_case_with_uppercase("HTTP")); // faster than `eq_ignore_ascii_case`

Crates.io

https://crates.io/crates/str-utils

文档

https://docs.rs/str-utils

许可证

MIT


lib.rs:

str Utils

此包提供了一些特质,用于扩展实现了 AsRef<[u8]>AsRef<str>.

示例

use str_utils::*;

assert_eq!(true, "foobar".starts_with_ignore_ascii_case("FoO"));
assert_eq!(Some(1), "photo.jpg".ends_with_ignore_ascii_case_multiple(&[".png", ".jpg", ".gif"]));
assert_eq!(true, "http".eq_ignore_ascii_case_with_uppercase("HTTP")); // faster than `eq_ignore_ascii_case`

依赖

~110KB