stringCollapser

Collapses a long comma separated string using a counter for repeated sub-strings

You are now following this Submission

Example 1-
Input string = 'abc,abc,abc,dcf,dcf,ef'.
output string ='3abc,2dcf,1ef'

Example 2-
Input string = 'xyzr,abdc,abdc,haha,haha'.
output string ='1xyzr,2abdc,2haha'

Explanation:
This function collapses a comma separated long string, containing sub-strings, into a possibly smaller string by replacing repeated sub-strings by counts of repetitions of substrings.

Cite As

Avinash Rude (2026). stringCollapser (https://www.mathworks.com/matlabcentral/fileexchange/26616-stringcollapser), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0