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

版本 1.1.0.0 (1.4 KB) 作者: Christian
Escapes special characters (\r, \t, ', ...) in a string and returns the escaped string.
450.0 次下载
更新时间 2013/5/24

查看许可证

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.

引用格式

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. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Characters and Strings 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Improved the description

1.0.0.0