Update string.md

This commit is contained in:
Jultimate 2022-03-16 09:22:24 +08:00 committed by GitHub
parent 7e20e180a0
commit ed09fe2082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -16,6 +16,16 @@ fn main() {
println!("{}",s)
}
```
```rust
fn main() {
let s: Box<&str> = "hello, world".into();
greetings(*s)
}
fn greetings(s: &str) {
println!("{}", s);
}
```
3.
```rust
@ -171,4 +181,4 @@ fn main() {
println!("{}", c)
}
}
```
```