taesik

Break camelCase 본문

functions and trick/RUST

Break camelCase

taesikk 2022. 6. 6. 17:46
"camelCasing"  =>  "camel Casing"
fn solution(s: &str) -> String {
    let mut res = String::new();
    for c in s.chars() {
        if c.is_uppercase() {
            res.push(' ');
        }
        res.push(c);
    }
    res
}

'functions and trick > RUST' 카테고리의 다른 글

return the number of vowels  (0) 2022.06.09
Masking with # except last 4 string  (0) 2022.06.09
Largest 5 digit number in a series  (0) 2022.06.06