20 个版本 (破坏性更新)

新增 0.16.0 2024 年 8 月 16 日
0.15.0 2024 年 6 月 29 日
0.14.0 2024 年 5 月 31 日
0.11.0 2024 年 3 月 26 日
0.1.8 2022 年 7 月 15 日

2254算法

Download history 35/week @ 2024-04-27 46/week @ 2024-05-04 190/week @ 2024-05-11 73/week @ 2024-05-18 379/week @ 2024-05-25 294/week @ 2024-06-01 54/week @ 2024-06-08 102/week @ 2024-06-15 46/week @ 2024-06-22 339/week @ 2024-06-29 11/week @ 2024-07-06 42/week @ 2024-07-13 64/week @ 2024-07-20 226/week @ 2024-07-27 33/week @ 2024-08-03 27/week @ 2024-08-10

368 每月下载量
用于 9 crate(3 个直接使用)

MIT 许可证

115KB
1.5K SLoC

模块 :: strs_tools

experimental rust-status docs.rs Open in Gitpod discord

字符串操作工具。

基本用法

#[ cfg( all( feature = "split", not( feature = "no_std" ) ) ) ]
{
  /* delimeter exists */
  let src = "abc def";
  let iter = strs_tools::string::split()
  .src( src )
  .delimeter( " " )
  .stripping( false )
  .perform();
  let iterated = iter.map( | e | String::from( e ) ).collect::< Vec< _ > >();
  assert_eq!( iterated, vec![ "abc", " ", "def" ] );

  /* delimeter not exists */
  let src = "abc def";
  let iter = strs_tools::string::split()
  .src( src )
  .delimeter( "g" )
  .perform();
  let iterated = iter.map( | e | String::from( e ) ).collect::< Vec< _ > >();
  assert_eq!( iterated, vec![ "abc def" ] );
}

添加到您的项目中

cargo add strs_tools

从仓库中尝试使用

git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/wstring_tools_trivial
cargo run

示例

discord Open in Gitpod docs.rs

依赖关系

~1.6–2.1MB
~42K SLoC