freeCodeCamp/curriculum/challenges/arabic/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-esca...

1.2 KiB

title id challengeType videoUrl localeTitle
Tokenize a string with escaping 594faaab4e2a8626833e9c3d 5

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(typeof tokenize === "function", "<code>tokenize</code> is a function.");'
  - text: ''
    testString: 'assert(typeof tokenize("a", "b", "c") === "object", "<code>tokenize</code> should return an array.");'
  - text: ''
    testString: 'assert.deepEqual(tokenize(testStr1, "|", "^"), res1, "<code>tokenize("one^|uno||three^^^^|four^^^|^cuatro|", "|", "^") </code> should return ["one|uno", "", "three^^", "four^|cuatro", ""]");'
  - text: ''
    testString: 'assert.deepEqual(tokenize(testStr2, "&", "@"), res2, "<code>tokenize("a@&bcd&ef&&@@hi", "&", "@")</code> should return <code>["a&bcd", "ef", "", "@hi"]</code>");'

Challenge Seed

function tokenize(str, esc, sep) {
  return true;
}

After Test

console.info('after the test');

Solution

// solution required