rust repeat character n times code example Example: rust repeat character x times Click to copylet formatted_title = format!("{:-^1$}", title, n);