Cody

Problem 2081. Concatenate strings

Solution 1210562

Submitted on 12 Jun 2017 by Said BOUREZG
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   Pass
x1 = 'a'; x2= 'b'; y_correct = 'ab'; assert(isequal(concatstrings(x1,x2),y_correct))

ans = 1×2 cell array 'a' 'b' ans = 'a b' ans = 'ab' ans = 'ab'

2   Pass
x1 = 'a'; x2= 'b'; x3= 'c'; y_correct = 'abc'; assert(isequal(concatstrings(x1,x2,x3),y_correct))

ans = 1×3 cell array 'a' 'b' 'c' ans = 'a b c' ans = 'abc' ans = 'abc'

3   Pass
x1 = 'my'; x2= ' '; x3= 'holiday'; x4= ' '; x5= 'is'; x6= ' almost over!'; y_correct = 'my holiday is almost over!'; assert(isequal(concatstrings(x1,x2,x3,x4,x5,x6),y_correct))

ans = 1×6 cell array 'my' '؟' 'holiday' '؟' 'is' '؟almost؟over!' ans = 'my ؟ holiday ؟ is ؟almost؟over!' ans = 'my؟holiday؟is؟almost؟over!' ans = 'my holiday is almost over!'

4   Pass
assert(isempty(concatstrings()))

ans = 0×0 empty cell array ans = 0×0 empty char array ans = 0×0 empty char array ans = 0×0 empty char array