commit
10d925cced
|
@ -155,6 +155,7 @@ fn main() {
|
||||||
/* Fill in the blank and fix the errors */
|
/* Fill in the blank and fix the errors */
|
||||||
fn main() {
|
fn main() {
|
||||||
let raw_str = r"Escapes don't work here: \x3F \u{211D}";
|
let raw_str = r"Escapes don't work here: \x3F \u{211D}";
|
||||||
|
// Modify above line to make it work
|
||||||
assert_eq!(raw_str, "Escapes don't work here: ? ℝ");
|
assert_eq!(raw_str, "Escapes don't work here: ? ℝ");
|
||||||
|
|
||||||
// If you need quotes in a raw string, add a pair of #s
|
// If you need quotes in a raw string, add a pair of #s
|
||||||
|
@ -166,6 +167,7 @@ fn main() {
|
||||||
let delimiter = r###"A string with "# in it. And even "##!"###;
|
let delimiter = r###"A string with "# in it. And even "##!"###;
|
||||||
println!("{}", delimiter);
|
println!("{}", delimiter);
|
||||||
|
|
||||||
|
// Fill the blank
|
||||||
let long_delimiter = __;
|
let long_delimiter = __;
|
||||||
assert_eq!(long_delimiter, "Hello, \"##\"");
|
assert_eq!(long_delimiter, "Hello, \"##\"");
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ fn main() {
|
||||||
```rust
|
```rust
|
||||||
fn main() {
|
fn main() {
|
||||||
let raw_str = "Escapes don't work here: \x3F \u{211D}";
|
let raw_str = "Escapes don't work here: \x3F \u{211D}";
|
||||||
// modify below line to make it work
|
// modify above line to make it work
|
||||||
assert_eq!(raw_str, "Escapes don't work here: ? ℝ");
|
assert_eq!(raw_str, "Escapes don't work here: ? ℝ");
|
||||||
|
|
||||||
// If you need quotes in a raw string, add a pair of #s
|
// If you need quotes in a raw string, add a pair of #s
|
||||||
|
@ -167,7 +167,7 @@ fn main() {
|
||||||
let delimiter = r###"A string with "# in it. And even "##!"###;
|
let delimiter = r###"A string with "# in it. And even "##!"###;
|
||||||
println!("{}", delimiter);
|
println!("{}", delimiter);
|
||||||
|
|
||||||
// fill the blank
|
// Fill the blank
|
||||||
let long_delimiter = r###"Hello, "##""###;
|
let long_delimiter = r###"Hello, "##""###;
|
||||||
assert_eq!(long_delimiter, "Hello, \"##\"")
|
assert_eq!(long_delimiter, "Hello, \"##\"")
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,6 +149,7 @@ fn main() {
|
||||||
/* 填空并修复所有错误 */
|
/* 填空并修复所有错误 */
|
||||||
fn main() {
|
fn main() {
|
||||||
let raw_str = r"Escapes don't work here: \x3F \u{211D}";
|
let raw_str = r"Escapes don't work here: \x3F \u{211D}";
|
||||||
|
// 修改上面的行让代码工作
|
||||||
assert_eq!(raw_str, "Escapes don't work here: ? ℝ");
|
assert_eq!(raw_str, "Escapes don't work here: ? ℝ");
|
||||||
|
|
||||||
// 如果你希望在字符串中使用双引号,可以使用以下形式
|
// 如果你希望在字符串中使用双引号,可以使用以下形式
|
||||||
|
|
Loading…
Reference in New Issue