chore(i18n,learn): processed translations (#49326)

This commit is contained in:
camperbot
2023-02-16 16:34:56 +05:30
committed by GitHub
parent 88752ccd6c
commit cd58053ced
540 changed files with 17855 additions and 1106 deletions

View File

@@ -9,36 +9,31 @@ dashedName: escape-sequences-in-strings
# --description--
引号不是字符串中唯一可以被转义(<dfn>escaped</dfn>)的字符。 使用转义字符有两个原因:
1. 首先是可以让你使用无法输入的字符,例如换行。
2. 其次是可以让你在一个字符串中表示多个引号,而不会出错。
我们在之前的挑战中学到了这个。
引号不是字符串中唯一可以被转义(<dfn>escaped</dfn>)的字符。 Escape sequences allow you to use characters you may not otherwise be able to use in a string.
<table class='table table-striped'><thead><tr><th>代码</th><th>输出</th></tr></thead><tbody><tr><td><code>\'</code></td><td>单引号</td></tr><tr><td><code>\"</code></td><td>双引号</td></tr><tr><td><code>\\</code></td><td>反斜杠</td></tr><tr><td><code>\n</code></td><td>换行符</td></tr><tr><td><code>\t</code></td><td>制表符</td></tr><tr><td><code>\r</code></td><td>回车</td></tr><tr><td><code>\b</code></td><td>退格</td></tr><tr><td><code>\f</code></td><td>换页符</td></tr></tbody></table>
*请注意,必须对反斜杠本身进行转义,它才能显示为反斜杠。*
*Note that the backslash itself must be escaped in order to display as a backslash.*
# --instructions--
使用转义序列把下面三行文本赋值给一个变量 `myStr`
Assign the following three lines of text into the single variable `myStr` using escape sequences.
<blockquote>FirstLine<br>    \SecondLine<br>ThirdLine</blockquote>
你需要使用转义字符正确地插入特殊字符。 确保间距与上面文本一致,并且单词或转义字符之间没有空格。
You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above, with no spaces between escape sequences or words.
**注意:**`SecondLine` 前面的空白是制表符,而不是空格。
**Note:** The indentation for `SecondLine` is achieved with the tab escape character, not spaces.
# --hints--
`myStr` 不能包含空格。
`myStr` should not contain any spaces
```js
assert(!/ /.test(myStr));
```
`myStr` 应包含字符串 `FirstLine``SecondLine` `ThirdLine`(记得区分大小写)。
`myStr` should contain the strings `FirstLine`, `SecondLine` and `ThirdLine` (remember case sensitivity)
```js
assert(
@@ -46,31 +41,31 @@ assert(
);
```
`FirstLine` 后面应该是一个换行符 `\n`
`FirstLine` should be followed by the newline character `\n`
```js
assert(/FirstLine\n/.test(myStr));
```
`myStr` 应该包含一个制表符 `\t`,它在换行符后面。
`myStr` should contain a tab character `\t` which follows a newline character
```js
assert(/\n\t/.test(myStr));
```
`SecondLine` 前面应该是反斜杠 `\`
`SecondLine` should be preceded by the backslash character `\`
```js
assert(/\\SecondLine/.test(myStr));
```
`SecondLine` `ThirdLine` 之间应该是换行符。
There should be a newline character between `SecondLine` and `ThirdLine`
```js
assert(/SecondLine\nThirdLine/.test(myStr));
```
`myStr` 应该只包含上面要求的字符。
`myStr` should only contain characters shown in the instructions
```js
assert(myStr === 'FirstLine\n\t\\SecondLine\nThirdLine');