diff --git a/en/src/compound-types/string.md b/en/src/compound-types/string.md index 627ce5e..4a1d135 100644 --- a/en/src/compound-types/string.md +++ b/en/src/compound-types/string.md @@ -54,7 +54,7 @@ fn main() { // Fix all errors without adding newline fn main() { - let s = String::from("hello"); + let s = String::from("hello"); s.push(','); s.push(" world"); s += "!".to_string(); @@ -89,8 +89,8 @@ fn main() { let s1 = String::from("hello,"); let s2 = String::from("world!"); let s3 = s1 + s2; - assert_eq!(s3,"hello,world!"); - println!("{}",s1); + assert_eq!(s3, "hello,world!"); + println!("{}", s1); } ``` @@ -107,7 +107,7 @@ fn main() { } fn greetings(s: String) { - println!("{}",s) + println!("{}", s) } ``` @@ -140,7 +140,7 @@ fn main() { println!("Unicode character {} (U+211D) is called {}", unicode_codepoint, character_name ); - let long_string = "String literals + let long_string = "String literals can span multiple lines. The linebreak and indentation here \ can be escaped too!"; @@ -163,7 +163,7 @@ fn main() { // If you need "# in your string, just use more #s in the delimiter. // You can use up to 65535 #s. - let delimiter = r###"A string with "# in it. And even "##!"###; + let delimiter = r###"A string with "# in it. And even "##!"###; println!("{}", delimiter); let long_delimiter = __; @@ -262,4 +262,4 @@ fn main() { } ``` -> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it \ No newline at end of file +> You can find the solutions [here](https://github.com/sunface/rust-by-practice)(under the solutions path), but only use it when you need it