Rust Programming2026-02-06 13:50

What is the difference between println! and print! in Rust?

rustfan
rustfan
Author

println! prints content and automatically adds a newline, while print! prints without adding a newline.

print!("no newline");
println!(" with newline");

Output: no newline with newline

27

Comments (0)

Login to comment

Login Now

Loading comments...