wstring_tools

Crates.iowstring_tools
lib.rswstring_tools
version0.1.5
sourcesrc
created_at2022-01-10 15:17:47.268284
updated_at2022-06-12 08:58:53.149583
descriptionTools to manipulate strings.
homepagehttps://github.com/Wandalen/wTools/tree/master/module/alias/wstring_tools
repositoryhttps://github.com/Wandalen/wTools/tree/master/module/alias/wstring_tools
max_upload_size
id511464
size806,597
Wandalen (Wandalen)

documentation

https://docs.rs/wstring_tools

README

Module :: wstring_tools

experimental rust-status docs.rs discord

Tools to manipulate strings.

Sample

#[ cfg( all( feature = "split", feature = "use_std" ) ) ]
{
  /* delimeter exists */
  let src = "abc def";
  let iter = wstring_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 = wstring_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 wstring_tools

Try out from the repository

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

cargo fmt