Cody

# Problem 44730. Substring Extraction

Solution 1660362

Submitted on 26 Oct 2018 by Michael Jarboe
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
input_str= 'This is a test sentence' Start_string= ' is' End_string= 'sentence' include_se=1 output_str= {' is a test sentence'} assert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))

input_str = 'This is a test sentence' Start_string = ' is' End_string = 'sentence' include_se = 1 output_str = 1×1 cell array {' is a test sentence'} output_str = 1×1 cell array {' is a test sentence'}

2   Pass
input_str= 'This is a test sentence' Start_string= ' is' End_string= 'sentence' include_se=0 output_str={' a test '} assert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))

input_str = 'This is a test sentence' Start_string = ' is' End_string = 'sentence' include_se = 0 output_str = 1×1 cell array {' a test '} a = 1×1 cell array {' a test '} output_str = 1×1 cell array {' a test '}

3   Pass
input_str= 'Right now!I said RIGHT NOW!' Start_string= 'now!' End_string= '!' include_se=0 output_str={'I said RIGHT NOW'} assert(isequal(extract_function(input_str,Start_string,End_string, include_se),output_str))

input_str = 'Right now!I said RIGHT NOW!' Start_string = 'now!' End_string = '!' include_se = 0 output_str = 1×1 cell array {'I said RIGHT NOW'} a = 1×1 cell array {'I said RIGHT NOW'} output_str = 1×1 cell array {'I said RIGHT NOW'}