Crate qndr

Source

Functionsยง

allow_alphabets_only
The allow_alphabets_only fn takes a &str and check that it should only consist of alphabets. It will return false even if one non-alphabetic char is found
allow_alphanumeric_only
The allow_alphanumeric_only fn takes a &str and check to see that it should only consist of alpha-numerical chars. The fn will return false even if one non-alpha-numerical char is found.
allow_numbers_only
The allow_numbers_only fn takes a &str and will check that it should only consist of numerical chars.The fn will return false even if one non-numeric char is found.
alphabets_with_symbols
The alphabets_with_symbols fn will allow just alphabets and the selected symbols e.g ! , @ etc. It takes a &str (sample ) and another &str with allowed symbols. It will return true only if the sample string has only alphabets and the allowed symbols provided.
alphanumeric_with_symbols
begin_with
This function checks if the sample &str begins with the provided character or not. Return true if it does.
begin_with_alphabet
This function checks if the sample &str begins with an alphabet or not. Return true if it does.
begin_with_alphanumeric
The begin_with_alphanumeric function checks if the sample &str begins with an alphanumeric or not.
begin_with_number
This function checks if the sample &str begins with a number or not. Return true if it does.
check_string_for_allowed_chars
This function will check the provided sample &str and check that it should only contain the provided characters.
end_with
This function checks if the sample &str ends with the provided character or not. Return true if it does.
end_with_alphabet
This function checks if the sample &str begins with an alphabet or not. Return true ifit does.
end_with_alphanumeric
The end_with_alphanumeric function checks if the sample &str ends with an alphanumeric or not. Return true if it does.
end_with_number
This function checks if the sample &str ends with a number or not.
get_alphabets
The get_alphabets fn takes a &str and return (as a new string) all the alphabetic chars.
get_alphanumeric
The get_alphanumeric fn takes a &str and return (as a new string) of all the alpha-numeric chars.
get_non_alphabets
The get_non_alphabets fn takes a &str and returns (as a new string) all the non alphabets chars .
get_non_alphanumeric
The get_non_alphanumeric pub fn takes &str and returns (as a new string) of all the non Alpha-Numeric chars.
get_non_numbers
The get_non_numbers fn takes a &str and returns (as a new string) of all the non-numeric chars .
get_numbers
The get_numbers fn takes a &str and return (as a new string) of all the numeric chars.
no_caps
The no_caps function will return None even if a single Capital character is found in the provided sample &str. Any character other than a capital case alphabet is OK
numbers_with_symbols
We use this pub fn if we want to allow just numbers and few selected symbols e.g ! , @ etc. It takes a &str (the sample string) and another &str with allowed symbols. It will return true only of the sample string has only numbers and the allowed symbols provided.
only_caps
The data presented to this function should be alphabatic and in all caps. If any char found that is not a capital alphabet the function will return false.
The sample &str should be entirely comprising of ABCDEFGHIJKLMNOPQRSTUVWXYZ
remove_chars
This function will remove all characters from the sample &str provided by the second argument.
string_to_vec
This fn converts a &String into a Vec of chars