String Letter Counter Function
Version 1.1.0.0 (1.35 KB) by
Avinash Rude
This function returns comma separated unique letter counts in an input string, keeping the order.
Statement: strLetterCounter('string')
....where, 'string' is an input string containing alphabet or numbers.
Ex: string='aaaaaaaabbbbbbccd'
Statement: strLetterCounter(string)
Output: '8a,6b,2c,1d'
Note: This function is different from the Matlab function called 'unique' because it keeps the order in which letters occur in the string.
Cite As
Avinash Rude (2024). String Letter Counter Function (https://www.mathworks.com/matlabcentral/fileexchange/26295-string-letter-counter-function), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2007a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Characters and Strings in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.