String count - MATLAB Cody - MATLAB Central

Problem 45245. String count

Difficulty:Rate

given a string 'str', count the number of the followings -

  • letters
  • digits
  • white space
  • capital letters
  • small letters
  • punctuation marks

output should be an array y containing the numbers in the same order.

Solution Stats

42.31% Correct | 57.69% Incorrect
Last Solution submitted on Jun 16, 2025

Problem Comments

Solution Comments

Show comments
Join Cody Contest 2025 — Have Fun and Win Prizes!
...
We’re excited to invite you to Cody Contest 2025! 🎉 Pick a team,...

Problem Recent Solvers19

Suggested Problems

More from this Author174

Problem Tags

Community Treasure Hunt

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

Start Hunting!