Cody

# Problem 44661. Remove white spaces at the end of the input string

Solution 1742456

Submitted on 4 Mar 2019 by Martin C.
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
A = 'This is a test string. '; y_correct = 'This is a test string.'; assert(isequal(rem_trail_ws(A),y_correct))

2   Pass
A = ' Testing function rem_trail_ws'; y_correct = ' Testing function rem_trail_ws'; assert(isequal(rem_trail_ws(A),y_correct))

3   Pass
A = {'MATLAB ','SIMULINK '; 'Toolboxes ','MathWorks '}; y_correct = {'MATLAB','SIMULINK'; 'Toolboxes','MathWorks'}; assert(isequal(rem_trail_ws(A),y_correct))

ce = 1×1 cell array {'MATLAB '} A = 2×2 cell array {'MATLAB' } {'SIMULINK ' } {'Toolboxes '} {'MathWorks '} ce = 1×1 cell array {'SIMULINK '} A = 2×2 cell array {'MATLAB' } {'SIMULINK' } {'Toolboxes '} {'MathWorks '} ce = 1×1 cell array {'Toolboxes '} A = 2×2 cell array {'MATLAB' } {'SIMULINK' } {'Toolboxes'} {'MathWorks '} ce = 1×1 cell array {'MathWorks '} A = 2×2 cell array {'MATLAB' } {'SIMULINK' } {'Toolboxes'} {'MathWorks'} y = 2×2 cell array {'MATLAB' } {'SIMULINK' } {'Toolboxes'} {'MathWorks'}

4   Pass
A = sprintf('MATHWORKS \t'); y_correct = 'MATHWORKS'; assert(isequal(rem_trail_ws(A),y_correct))