Crates.io | strs_tools |
lib.rs | strs_tools |
version | 0.15.0 |
source | src |
created_at | 2022-06-12 06:44:33.476186 |
updated_at | 2024-06-29 18:08:29.102806 |
description | Tools to manipulate strings. |
homepage | https://github.com/Wandalen/wTools/tree/master/module/core/strs_tools |
repository | https://github.com/Wandalen/wTools/tree/master/module/core/strs_tools |
max_upload_size | |
id | 604409 |
size | 107,291 |
Tools to manipulate strings.
#[ 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