1.9 KiB
1.9 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7dbb367417b2b2512bac | Remove Whitespace from Start and End | 1 | إزالة Whitespace من البداية والنهاية |
Description
Instructions
.trim()
طريقة .trim()
هنا ، ولكن ستحتاج إلى إكمال هذا التحدي باستخدام التعبيرات العادية. Tests
tests:
- text: 'يجب أن تساوي <code>result</code> <code>"Hello, World!"</code>'
testString: 'assert(result == "Hello, World!", "<code>result</code> should equal to <code>"Hello, World!"</code>");'
- text: يجب عدم استخدام طريقة <code>.trim()</code> .
testString: 'assert(!code.match(/\.trim\(.*?\)/), "You should not use the <code>.trim()</code> method.");'
- text: لا ينبغي تعيين متغير <code>result</code> مساو لسلسلة.
testString: 'assert(!code.match(/result\s*=\s*".*?"/), "The <code>result</code> variable should not be set equal to a string.");'
Challenge Seed
let hello = " Hello, World! ";
let wsRegex = /change/; // Change this line
let result = hello; // Change this line
Solution
// solution required