cv2_crate/
string_utils.rs

1pub fn reverse(text: &str) -> String{
2    String::from("reversed string")
3}
4
5/// This function converts given text to uppercase
6pub fn to_uppercase(text: &str) -> String{
7    let mut retstr: String = String::new();
8    for s in text.chars(){
9        if s.is_ascii_lowercase(){
10            retstr.push((s as u8 - 32) as char);
11        }else{
12            retstr.push(s);
13        }
14    }
15    retstr
16}
17
18/// This function converts given text to lowercase
19pub fn to_lowercase(text: &str) -> String{
20    let mut retstr: String = String::new();
21    for s in text.chars(){
22        if s.is_ascii_uppercase(){
23            retstr.push((s as u8 + 32) as char);
24        }else{
25            retstr.push(s);
26        }
27    }
28    retstr
29}
30
31pub fn replace_all(text: &str, old_sub: &str, new_sub: &str){
32
33}
34
35pub fn match_pattern(text: &str, pattern: &str){
36
37}