<!-- {{# generate.module_header{} #}} -->
# Module :: strs_tools
<!--{ generate.module_header.start() }-->
[](https://github.com/emersion/stability-badges#experimental) [](https://github.com/Wandalen/wTools/actions/workflows/module_strs_tools_push.yml) [](https://docs.rs/strs_tools) [](https://gitpod.io/#RUN_PATH=.,SAMPLE_FILE=module%2Fcore%2Fstrs_tools%2Fexamples%2Fstrs_tools_trivial.rs,RUN_POSTFIX=--example%20strs_tools_trivial/https://github.com/Wandalen/wTools) [](https://discord.gg/m3YfbXpUUY)
<!--{ generate.module_header.end }-->
Tools to manipulate strings.
### Basic use-case
<!-- {{# generate.module{} #}} -->
```rust
#[ 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" ] );
}
```
### To add to your project
```sh
cargo add strs_tools
```
### Try out from the repository
```sh
git clone https://github.com/Wandalen/wTools
cd wTools
cd examples/wstring_tools_trivial
cargo run
```
# Sample
[](https://discord.gg/m3YfbXpUUY)
[](https://gitpod.io/#RUN_PATH=sample%2Frust%2Fstrs_tools_trivial,SAMPLE_FILE=.%2Fsrc%2Fmain.rs/https://github.com/Wandalen/wTools)
[](https://docs.rs/strs_tools)