Problem 45245. String count
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
Problem Comments
-
4 Comments
Tim,
I am not quite sure where did that amp came from in test-2.
it wasn't in my original test suite.
in test-3, grave accent is not a punctuation mark - so far i know.
For some reason, according to Matlab function isstrprop, the characters $ + < = > ^ ` | ~ are not considered to be punctuation marks, or letters, or digits, or anything else--this seems to be discriminatory and unjust.
This problem has an interesting take on punctuation characters.
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
Project Euler: Problem 1, Multiples of 3 and 5
3422 Solvers
-
842 Solvers
-
middleAsColumn: Return all but first and last element as a column vector
614 Solvers
-
640 Solvers
-
How to find the position of an element in a vector without using the find function
42 Solvers
More from this Author165
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!