fn pad_right(s: &str, total_len: usize, pad_char: char) -> String {
let pad_len = total_len.saturating_sub(s.len());
format!("{}{}", s, pad_char.to_string().repeat(pad_len))
}
fn main() {
let padded = pad_right("Rust", 7, '*');
println!("{}", padded);
}
/*
run:
Rust***
*/