rust-by-practice/solutions/formatted-output/println.md

18 lines
260 B
Markdown
Raw Normal View History

2022-03-15 06:05:03 -06:00
1.
```rust
fn main() {
let s1 = "hello";
/* Fill in the blank */
let s = format!("{}, world!", s1);
assert_eq!(s, "hello, world!");
}
```
2.
```rust
fn main() {
print!("hello world, ");
println!("I am");
println!("Sunface!");
}
```