Cody

# Problem 43645. Check if a string starts with another string

Solution 1282290

Submitted on 6 Oct 2017
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
s = 'Trick-or-treating is a customary celebration for children on Halloween'; q= 'trick' y_correct = true; assert(isequal(CheckString(s,q),y_correct))

q = 'trick'

Error using / Matrix dimensions must agree. Error in CheckString (line 2) ans = s/q; Error in Test1 (line 4) assert(isequal(CheckString(s,q),y_correct))

2   Fail
s = 'Trick-or-treating is a customary celebration for children on Halloween'; q= 'trick-Or' y_correct = true; assert(isequal(CheckString(s,q),y_correct))

q = 'trick-Or'

Error using / Matrix dimensions must agree. Error in CheckString (line 2) ans = s/q; Error in Test2 (line 4) assert(isequal(CheckString(s,q),y_correct))

3   Fail
s = 'Trick-or-treating is a customary celebration for children on Halloween'; q= 'trick--or' y_correct = false; assert(isequal(CheckString(s,q),y_correct))

q = 'trick--or'

Error using / Matrix dimensions must agree. Error in CheckString (line 2) ans = s/q; Error in Test3 (line 4) assert(isequal(CheckString(s,q),y_correct))

4   Fail
s = 'Haunted attractions are entertainment venues designed to thrill and scare patrons.'; q= 'Hello' y_correct = false; assert(isequal(CheckString(s,q),y_correct))

q = 'Hello'

Error using / Matrix dimensions must agree. Error in CheckString (line 2) ans = s/q; Error in Test4 (line 4) assert(isequal(CheckString(s,q),y_correct))