add solutions for string.md

This commit is contained in:
sunface
2022-03-02 20:57:13 +08:00
parent 2d7e251e8b
commit 0f4685dcf0
6 changed files with 355 additions and 34 deletions

View File

@ -45,10 +45,12 @@ fn borrow_object(s: &String) {}
fn main() {
let mut s = String::from("hello, ");
borrow_object(&s)
push_str(s)
}
fn borrow_object(s: &mut String) {}
fn push_str(s: &mut String) {
s.push_str("world")
}
```
🌟🌟
@ -151,7 +153,7 @@ fn main() {
}
```
🌟🌟🌟
🌟🌟
```rust,editable
fn main() {