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

Versión 1.1.0.0 (1,41 KB) por Christian
Escapes special characters (\r, \t, ', ...) in a string and returns the escaped string.
450 descargas
Actualizado 24 may 2013

Ver licencia

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.

Citar como

Christian (2024). escapeString: convert special characters in a string into their escape sequences (https://www.mathworks.com/matlabcentral/fileexchange/41512-escapestring-convert-special-characters-in-a-string-into-their-escape-sequences), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2012a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Characters and Strings en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.1.0.0

Improved the description

1.0.0.0