Simple String Cleanup Utility
Version 1.0.0.0 (347 Bytes) by
Rob Slazas
Simple utility function that cleans up stray characters and spaces from strings so they can be used
1.2K Downloads
Updated
12 Sep 2008
No License
Simple utility function that cleans up stray characters and spaces from strings so they can be used without causing errors or changes in format.
Function call removes anything not alphabetic or numeric, including underscore:
newstr = cleanstr(instr)
* I leave this function in my path and end up calling it pretty often. Works well with strings grabbed from filenames to be used in titles or legends on plots. Can be called embedded from those formatting statements.
Cite As
Rob Slazas (2026). Simple String Cleanup Utility (https://uk.mathworks.com/matlabcentral/fileexchange/21419-simple-string-cleanup-utility), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2008a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Characters and Strings in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
