Cody

# Problem 44294. Simple String Concatenation

Solution 1697652

Submitted on 20 Dec 2018 by HH
• Size: 9
• This is the leading solution.
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
str1 = 'apple'; str2 = 'pear'; concat_str = 'apple pear'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint1 (line 4) In solutionTest (line 3)]

2   Pass
str1 = 'one'; str2 = 'two'; concat_str = 'one two'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)]

3   Pass
str1 = 'one two'; str2 = 'three four'; concat_str = 'one two three four'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint3 (line 4) In solutionTest (line 7)]

4   Pass
str1 = 'hello'; str2 = 'there'; concat_str = 'hello there'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint4 (line 4) In solutionTest (line 9)]

5   Pass
str1 = 'This is half a sentence;'; str2 = 'here is the other half.'; concat_str = 'This is half a sentence; here is the other half.'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint5 (line 4) In solutionTest (line 11)]

6   Pass
str1 = 'left'; str2 = 'right'; concat_str = 'left right'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint6 (line 4) In solutionTest (line 13)]

7   Pass
str1 = 'right'; str2 = 'left'; concat_str = 'right left'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint7 (line 4) In solutionTest (line 15)]

8   Pass
str1 = ' leading space'; str2 = 'trailing space '; concat_str = ' leading space trailing space '; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint8 (line 4) In solutionTest (line 17)]

9   Pass
str1 = '123'; str2 = '456'; concat_str = '123 456'; assert(isequal(your_fcn_name(str1, str2),concat_str))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint9 (line 4) In solutionTest (line 19)]

### Community Treasure Hunt

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

Start Hunting!