4 releases

Uses new Rust 2021

0.1.7 Jun 23, 2022
0.1.6 Jun 13, 2022
0.1.5 Jun 12, 2022
0.1.0 Jun 12, 2022

#1053 in Development tools

Download history 883/week @ 2022-06-07 2530/week @ 2022-06-14 4670/week @ 2022-06-21 3556/week @ 2022-06-28

11,639 downloads per month
Used in 6 crates (2 directly)

MIT license

1MB
24K SLoC

Module :: strs_tools

experimental rust-status docs.rs Open in Gitpod discord

Tools to manipulate strings.

Sample

#[ cfg( all( feature = "split", feature = "use_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" ] );
}

To add to your project

cargo add strs_tools

Try out from the repository

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

Dependencies

~3.5MB
~96K SLoC