Be the first to rate this file! 19 downloads (last 30 days) File Size: 3.25 KB File ID: #25122

TextTools

by Perttu Ranta-aho

 

24 Aug 2009

Code covered by BSD License  

Collection of small macros for text manipulation

Download Now | Watch this File

File Information
Description

TextTools provides a small collection of macros for text manipulation. They are intended to be used together with EditorMacro http://www.mathworks.com/matlabcentral/fileexchange/24615.
 
Included macros are:
       transpose_chars
              Swap characters around the caret
       transpose_words
              Swap words around the caret
       capitalize
              Capitalize word starting from caret location
       fill_comment
              Wrap current comment paragraph. Selects current comment paragraph and wraps and indents it.
              Follows Editor's comment width preference.

Syntax:
     tt = TextTools;
     ttMacro = TextTools(MacroName)
 
Examples:
     tt = TextTools;
     EditorMacro('Alt-Q',tt.fill_comment,'run')
  
     EditorMacro('Shift-Ctrl-T',TextTools('transpose_words'),'run')
 
 
 Warning:
     This code heavily relies on undocumented and unsupported Matlab functionality. Use at your own risk!

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
EditorMacro - assign a macro to a keyboard key-stroke in the Matlab Editor and Command Window

MATLAB release MATLAB 7.5 (R2007b)
Zip File Content  
Other Files license.txt,
TextTools.m
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
editor Perttu Ranta-aho 24 Aug 2009 15:57:19
undocumented Perttu Ranta-aho 24 Aug 2009 15:57:19
macro Perttu Ranta-aho 24 Aug 2009 15:57:19
 

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