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§

source

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());
source

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());
source

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());
source

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());
source

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());
source

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());
source

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());
source

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());

Implementations on Foreign Types§

source§

impl<N: Alphanumeric> ArrayStringValidate<N> for Result<Array<N>, ArrayError>

Implementors§