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

Solution 1572153

Submitted on 30 Jun 2018 by Srishti Saha
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
sentence = 'this is BETTER than C++'; corrected = 'This Is Better Than C++'; assert(isequal(autoCase(sentence), corrected))

str = 'this is better than c++' idx = 1 6 9 16 21 str = 'This Is Better Than C++' corrected = 'This Is Better Than C++'

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

str = 'hey, this is very wrong!' idx = 1 6 11 14 19 str = 'Hey, This Is Very Wrong!' corrected = 'Hey, This Is Very Wrong!'

Suggested Problems

More from this Author25

Community Treasure Hunt

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

Start Hunting!