Cody

# Problem 1218. Join Strings with Multiple Different Delimiters

Solution 1902491

Submitted on 16 Aug 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
C = {'I','MATLAB'}; DELIMITER = {' love '} S= 'I love MATLAB' assert(isequal(your_fcn_name(C,DELIMITER),S))

DELIMITER = 1×1 cell array {' love '} S = 'I love MATLAB' t = 1×2 cell array {'I'} {' love '}

Output argument "S" (and maybe others) not assigned during call to "your_fcn_name". Error in Test1 (line 4) assert(isequal(your_fcn_name(C,DELIMITER),S))

2   Fail
c = {'one', 'two', 'three'}; DELIM = {' + ', ' = '} S2= 'one + two = three' assert(isequal(your_fcn_name(c,DELIM),S2))

DELIM = 1×2 cell array {' + '} {' = '} S2 = 'one + two = three' t = 1×3 cell array {'one'} {' + '} {' = '} t = 1×6 cell array {'one'} {' + '} {' = '} {'two'} {' + '} {' = '}

Output argument "S" (and maybe others) not assigned during call to "your_fcn_name". Error in Test2 (line 4) assert(isequal(your_fcn_name(c,DELIM),S2))

3   Fail
c = {'First sentence', 'Second sentence', 'Third sentence.'}; DELIM = {'. ', '. '} S2= 'First sentence. Second sentence. Third sentence.' assert(isequal(your_fcn_name(c,DELIM),S2))

DELIM = 1×2 cell array {'. '} {'. '} S2 = 'First sentence. Second sentence. Third sentence.' t = 1×3 cell array {'First sentence'} {'. '} {'. '} t = 1×6 cell array {'First sentence'} {'. '} {'. '} {'Second sentence'} {'. '} {'. '}

Output argument "S" (and maybe others) not assigned during call to "your_fcn_name". Error in Test3 (line 4) assert(isequal(your_fcn_name(c,DELIM),S2))

4   Fail
c = {'Have you ', 'ever had ', 'someone continuously ', 'interrupting you?'}; DELIM = {'(HEY!) ', '(BOO!) ', '(LOOK OVER THERE!) '} S2= 'Have you (HEY!) ever had (BOO!) someone continuously (LOOK OVER THERE!) interrupting you?' assert(isequal(your_fcn_name(c,DELIM),S2))

DELIM = 1×3 cell array {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THERE!) '} S2 = 'Have you (HEY!) ever had (BOO!) someone continuously (LOOK OVER THERE!) interrupting you?' t = 1×4 cell array {'Have you '} {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THERE!) '} t = 1×8 cell array {'Have you '} {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THER…'} {'ever had '} {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THER…'} t = 1×12 cell array Columns 1 through 9 {'Have you '} {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THER…'} {'ever had '} {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THER…'} {'someone continu…'} Columns 10 through 12 {'(HEY!) '} {'(BOO!) '} {'(LOOK OVER THER…'}

Output argument "S" (and maybe others) not assigned during call to "your_fcn_name". Error in Test4 (line 4) assert(isequal(your_fcn_name(c,DELIM),S2))

5   Fail
c = {'My first ', 'name ', 'is ', 'Tom.'}; DELIM = {'child has a ', 'that ', 'not '} S2= 'My first child has a name that is not Tom.' assert(isequal(your_fcn_name(c,DELIM),S2))

DELIM = 1×3 cell array {'child has a '} {'that '} {'not '} S2 = 'My first child has a name that is not Tom.' t = 1×4 cell array {'My first '} {'child has a '} {'that '} {'not '} t = 1×8 cell array {'My first '} {'child has a '} {'that '} {'not '} {'name '} {'child has a '} {'that '} {'not '} t = 1×12 cell array {'My first '} {'child has a '} {'that '} {'not '} {'name '} {'child has a '} {'that '} {'not '} {'is '} {'child has a '} {'that '} {'not '}

Output argument "S" (and maybe others) not assigned during call to "your_fcn_name". Error in Test5 (line 4) assert(isequal(your_fcn_name(c,DELIM),S2))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!