Cody

# Problem 44499. Capitilize the first letter of every word in a string

Solution 1922130

Submitted on 4 Sep 2019
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
sentence = 'this is BETTER than C++'; corrected = 'This Is Better Than C++'; assert(isequal(autoCase(sentence), corrected))

s = 'this is better than c++' t = 1×6 cell array {'t'} {'i'} {'b'} {'t'} {'c'} {'+'} t = 'TIBTC+'

Output argument "corrected" (and maybe others) not assigned during call to "autoCase". Error in Test1 (line 3) assert(isequal(autoCase(sentence), corrected))

2   Fail
sentence = 'hEy, tHis iS vErY wroNg!'; corrected = 'Hey, This Is Very Wrong!'; assert(isequal(autoCase(sentence), corrected))

s = 'hey, this is very wrong!' t = 1×6 cell array {'h'} {' '} {'t'} {'i'} {'v'} {'w'} t = 'H TIVW'

Output argument "corrected" (and maybe others) not assigned during call to "autoCase". Error in Test2 (line 3) assert(isequal(autoCase(sentence), corrected))

3   Fail
sentence = 'tHIS sENTENCE wILL bE iNVERTED'; corrected = 'This Sentence Will Be Inverted'; assert(isequal(autoCase(sentence), corrected))

s = 'this sentence will be inverted' t = 1×5 cell array {'t'} {'s'} {'w'} {'b'} {'i'} t = 'TSWBI'

Output argument "corrected" (and maybe others) not assigned during call to "autoCase". Error in Test3 (line 3) assert(isequal(autoCase(sentence), corrected))

4   Fail
sentence = 'This Sentence Will Not Be Changed'; corrected = 'This Sentence Will Not Be Changed'; assert(isequal(autoCase(sentence), corrected))

s = 'this sentence will not be changed' t = 1×6 cell array {'t'} {'s'} {'w'} {'n'} {'b'} {'c'} t = 'TSWNBC'

Output argument "corrected" (and maybe others) not assigned during call to "autoCase". Error in Test4 (line 3) assert(isequal(autoCase(sentence), corrected))

5   Fail
sentence = 'HELLO THERE'; corrected = 'Hello There'; assert(isequal(autoCase(sentence), corrected))

s = 'hello there' t = 1×2 cell array {'h'} {'t'} t = 'HT'

Output argument "corrected" (and maybe others) not assigned during call to "autoCase". Error in Test5 (line 3) assert(isequal(autoCase(sentence), corrected))

6   Fail
sentence = 'AlTeRnAtInG cApS'; corrected = 'Alternating Caps'; assert(isequal(autoCase(sentence), corrected))

s = 'alternating caps' t = 1×2 cell array {'a'} {'c'} t = 'AC'

Output argument "corrected" (and maybe others) not assigned during call to "autoCase". Error in Test6 (line 3) assert(isequal(autoCase(sentence), corrected))