9 个版本
| 0.2.5 | 2022 年 9 月 6 日 |
|---|---|
| 0.2.4 | 2022 年 9 月 6 日 |
| 0.2.2 | 2022 年 7 月 12 日 |
| 0.1.3 | 2022 年 7 月 9 日 |
175 在 无标准库 中
每月 24 次下载
32KB
703 行
分割器
字符串和切片分割库
字符串示例
use splitter::StrSplitter;
let sp = StrSplitter::new("bytes example", " ");
assert_eq!(
sp.collect::<Vec<_>>(),
vec!["bytes", " ", "example"],
);
切片示例
use splitter::Splitter;
let sp = Splitter::new(&[1, 2, 3, 3, 4], [[2], [4]]);
let re: Vec<&[usize]> = vec![&[1], &[2], &[3, 3], &[4]];
assert_eq!(sp.collect::<Vec<_>>(), re);
查看示例以获取更多信息
功能
std- 启用标准库(目前仅与impls- 功能一起使用)impls- 自动为Info和StrInfo实现core和std中的有用类型infos- 添加预定义的有用Info和StrInfo类型derive- 启用Info和StrInfoderive 宏full- 启用所有功能
自动实现
impls - 功能
core::pin::Pincore::marker::PhantomDatacore::marker::PhantomPinnedcore::mem::ManuallyDropcore::cell::Cellcore::cell::RefCellcore::cell::UnsafeCellcore::ops::Rangecore::ops::RangeInclusive
impls 和 std - 功能
std::boxed::Boxstd::rc::Rcstd::sync::Arcstd::sync::Mutexstd::sync::RwLockstd::vec::Vec(仅用于切片)std::path::PathBuf(仅用于字符串)std::string::String(仅用于字符串)
依赖项
~215KB