Rust formatting controls how text and values appear when printed. The `println!` macro supports escapes, raw strings, byte output, Unicode escapes, and formatted values. section 2.10
fn main() {
let title = "TODAY'S NEWS";
println!("{:-^30}", title); #1
let bar = "|";
println!("{: <15}{: >15}", bar, bar); #2
let a = "SEOUL";
let b = "TOKYO";
println!("{city1:-<15}{city2:->15}", city1 = a, city2 = b); #3
}
Use fill characters, alignment markers, and field widths to shape output; named arguments can make the format string easier to follow. section 2.10
Other formatting options let you:
- Choose how values appear, such as Debug output, pointer addresses, or binary, hexadecimal, and octal numbers. section 2.10
- Select positional or named values and align them within a minimum width. section 2.10






