Expand description
Tools to manipulate strings.
§Module :: strs_tools
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 runModules§
- exposed
- Exposed namespace of the module.
- orphan
- Parented namespace of the module.
- prelude
- Namespace of the module to include with
use module::*. - protected
- Protected namespace of the module.
- string
- String tools.
Traits§
- Isolate
Options Adapter - Adapter for IsolateOptions.
- Parse
Options Adapter - Adapter for ParseOptions.
- Split
Options Adapter - Adapter for Split Options.
Functions§
- indentation
- Add indentation to each line.
- isolate
- Function to split a string with some delimeter.
- isolate_
left - Function to split a string with some delimeter. Routine splits string from left.
- isolate_
right - Function to split a string with some delimeter. Routine splits string from right.
- request_
parse - Function to parse a string with command request.
- split
- Function to split a string.