Text processing - Help Johnny write a letter home from camp - MATLAB Cody - MATLAB Central

Problem 2440. Text processing - Help Johnny write a letter home from camp

Difficulty:Rate
Johnny overuses the word 'great'. Write a script that will help him with this and future letters. If a sentence contains more than one occurrence of 'great', replace the second occurrence with 'awesome'.
textIn = strcat('I am having a great time at summer camp. The camp', ...
' counselors are great and the activities are great. Monday', ...
' we went kayaking and Tuesday we learned archery. Archery was', ...
' great and I hit the bull''s eye which everyone was said was', ...
' really great. -Love Johnny');

Solution Stats

39.93% Correct | 60.07% Incorrect
Last Solution submitted on Mar 15, 2023

Problem Comments

Solution Comments

Show comments
R2025a Pre-release highlights
This topic is for discussing highlights to the current R2025a Pre-release.
13
5

Problem Recent Solvers71

Suggested Problems

More from this Author3

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page