* fix: Chinese test suite Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working. * fix: ran script, updated testStrings and solutions
1.4 KiB
1.4 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7dbb367417b2b2512bac | Remove Whitespace from Start and End | 1 | 从开始和结束中删除空格 |
Description
Instructions
.trim()
方法可以在这里工作,但您需要使用正则表达式完成此挑战。 Tests
tests:
- text: '<code>result</code>应该等于<code>"Hello, World!"</code>'
testString: assert(result == "Hello, World!");
- text: 您不应该使用<code>.trim()</code>方法。
testString: assert(!code.match(/\.trim\([\s\S]*?\)/));
- text: <code>result</code>变量不应设置为等于字符串。
testString: assert(!code.match(/result\s*=\s*".*?"/));
Challenge Seed
let hello = " Hello, World! ";
let wsRegex = /change/; // Change this line
let result = hello; // Change this line
Solution
// solution required