qx_rs_str 0.0.0

quick str util in rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::str;

pub fn combine(a: &str, b: &str) -> String {
    let b = str::check_or_remove_suffix(b, "/");
    if a.ends_with('/') {
        if b.starts_with('/') {
            format!("{}{}", a, str::check_or_remove_prefix(b, "/"))
        } else {
            format!("{}{}", a, b)
        }
    } else {
        if b.starts_with('/') {
            format!("{a}{b}")
        } else {
            format!("{a}/{b}")
        }
    }
}