onigiri is the tool of handling chars
in Rust.
The japanese name of rice ball is "Onigiri".
In my image, a grain of rice is char
.
And what collected them is chars
.
Add
- validator::is_lower_ascii
- validator::is_upper_ascii
- validator::is_title
Removed tools::create_vvchar
.
Renamed validator::is_symbol
-> validator::is_punctuation
Modified DocComment and DocTest.
Removed what seems useless from tools.rs
.
Then I renamed is_number
, is_positive_number
, is_negative_number
to is_integer
, is_positive_integer
, is_negative_integer
.
Accordingly, I added is_float
, is_positive_float
and is_negative_float
newly.
Renamed create_btm
to to_btm
.
Vvc make it possible to specify a separator.
Added new function search_all
.
You add onigiri in Cargo.toml.
[dependencies]
onigiri = "0.1.13"
example is as follows.
``` use onigiri::tools::{Vvc, cast}; use onigiri::validator;
fn main() { let testtext = "(13 + 2)".tostring();
let new_vvchar = Vvc::new(&test_text, ' ');
assert_eq!(
&new_vvchar,
&vec![vec!['(', '1','3'],vec!['+'],vec!['2', ')']]
);
let thirteen = &new_vvchar[0][1..].to_vec();
assert_eq!(validator::is_positive_integer(&thirteen), true);
let num = cast::<u8>(&thirteen);
assert_eq!(&num, &Some(13_u8));
assert_eq!(&num.unwrap() + 2, 15_u8);
} ```