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

Version 1.1.0.0 (1,41 ko) par Christian
Escapes special characters (\r, \t, ', ...) in a string and returns the escaped string.
450 téléchargements
Mise à jour 24 mai 2013

Afficher la licence

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.

Citation pour cette source

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. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2012a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Characters and Strings dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.1.0.0

Improved the description

1.0.0.0