Be the first to rate this file! 132 downloads (last 30 days) File Size: 385 Bytes File ID: #21419

Simple String Cleanup Utility

by Rob Slazas

 

11 Sep 2008 (Updated 12 Sep 2008)

No BSD License  

Simple utility function that cleans up stray characters and spaces from strings so they can be used

Download Now | Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
strings Rob Slazas 22 Oct 2008 10:19:03
clean Rob Slazas 22 Oct 2008 10:19:03
cleanup Rob Slazas 22 Oct 2008 10:19:03
string Rob Slazas 22 Oct 2008 10:19:03
format Rob Slazas 22 Oct 2008 10:19:03
character Rob Slazas 22 Oct 2008 10:19:03
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com