Be the first to rate this file! 17 Downloads (last 30 days) File Size: 1.41 KB File ID: #41512

escapeString: convert special characters in a string into their escape sequences

by

 

26 Apr 2013 (Updated )

Escapes special characters (\r, \t, ', ...) in a string and returns the escaped string.

| Watch this File

File Information
Description

Escapes special characters such as line feeds or tabs in a string and returns the escaped string. Useful for debug purposes.
Receives a string as a parameter and returns the escaped string that will reproduce the string when printing it with sprintf().
If you need to write the escape sequence using sprintf, double escaping by using
sprintf(escapeString(escapeString(str)))
or passing a single escaped string as parameter sprintf('%s',escapeString(str)) will do the trick.
Note that this function is not optimized for speed.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Other requirements May work with versions prior to R2012a.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
24 May 2013

Improved the description

Contact us