Function freedit::controller::db_utils::extract_element
source · pub(super) fn extract_element(
input: &str,
max_len: usize,
char: char
) -> Vec<String>
Expand description
extract element from string
§Note
The tag length should be less than or equal to 25. And the results should be no more than max_len
.
If no space is found after the char
, the string will be ignored.
§Examples
ⓘ
let input = "hi, @cc this is a test. If no space at last, @notag";
let out = extract_element(input, 3, '@');
assert_eq!(out, vec!["cc"]);