Trait arr_rs::alphanumeric::operations::validate::ArrayStringValidate
source · pub trait ArrayStringValidate<N: Alphanumeric>where
Self: Sized + Clone,{
// Required methods
fn is_alpha(&self) -> Result<Array<bool>, ArrayError>;
fn is_alnum(&self) -> Result<Array<bool>, ArrayError>;
fn is_decimal(&self) -> Result<Array<bool>, ArrayError>;
fn is_numeric(&self) -> Result<Array<bool>, ArrayError>;
fn is_digit(&self) -> Result<Array<bool>, ArrayError>;
fn is_space(&self) -> Result<Array<bool>, ArrayError>;
fn is_lower(&self) -> Result<Array<bool>, ArrayError>;
fn is_upper(&self) -> Result<Array<bool>, ArrayError>;
}Expand description
ArrayTrait - Alphanumeric Array operations
Required Methods§
sourcefn is_alpha(&self) -> Result<Array<bool>, ArrayError>
fn is_alpha(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are alphabetic and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, false, false]);
let arr = Array::flat(vec!["abcd".to_string(), "abc12".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_alpha());sourcefn is_alnum(&self) -> Result<Array<bool>, ArrayError>
fn is_alnum(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are alphanumeric and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, true, false]);
let arr = Array::flat(vec!["abcd".to_string(), "abc12".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_alnum());sourcefn is_decimal(&self) -> Result<Array<bool>, ArrayError>
fn is_decimal(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are decimal and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, false, false]);
let arr = Array::flat(vec!["12345".to_string(), "abc12".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_decimal());sourcefn is_numeric(&self) -> Result<Array<bool>, ArrayError>
fn is_numeric(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are numeric and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, true, false, false, false, false, false]);
let arr = Array::flat(vec!["2".to_string(), "12345".to_string(), "a".to_string(), "abc12".to_string(), "1/4".to_string(), "VIII".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_numeric());sourcefn is_digit(&self) -> Result<Array<bool>, ArrayError>
fn is_digit(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are digits and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, false, false, false, false]);
let arr = Array::flat(vec!["2".to_string(), "12345".to_string(), "a".to_string(), "abc12".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_digit());sourcefn is_space(&self) -> Result<Array<bool>, ArrayError>
fn is_space(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are whitespace and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![false, false, false, false, true, true]);
let arr = Array::flat(vec!["2".to_string(), "12345".to_string(), "a".to_string(), "abc12".to_string(), " ".to_string(), " ".to_string()]);
assert_eq!(expected, arr.is_space());sourcefn is_lower(&self) -> Result<Array<bool>, ArrayError>
fn is_lower(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are lowercase and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, true, false, false, false]);
let arr = Array::flat(vec!["a".to_string(), "abc12".to_string(), "1234".to_string(), "aBc12".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_lower());sourcefn is_upper(&self) -> Result<Array<bool>, ArrayError>
fn is_upper(&self) -> Result<Array<bool>, ArrayError>
Check if all characters in the string are uppercase and there is at least one character
Examples
use arr_rs::prelude::*;
let expected = Array::flat(vec![true, true, false, false, false]);
let arr = Array::flat(vec!["A".to_string(), "ABC12".to_string(), "1234".to_string(), "aBc12".to_string(), "".to_string()]);
assert_eq!(expected, arr.is_upper());