Crates.io | wstring_tools |
lib.rs | wstring_tools |
version | 0.1.5 |
source | src |
created_at | 2022-01-10 15:17:47.268284 |
updated_at | 2022-06-12 08:58:53.149583 |
description | Tools to manipulate strings. |
homepage | https://github.com/Wandalen/wTools/tree/master/module/alias/wstring_tools |
repository | https://github.com/Wandalen/wTools/tree/master/module/alias/wstring_tools |
max_upload_size | |
id | 511464 |
size | 806,597 |
Tools to manipulate strings.
#[ 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" ] );
}
cargo add wstring_tools
git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/wstring_tools_trivial
cargo run