我有一个字符串:
str = Earth is round
如何在开头和结尾添加双引号?结果应该是:
str = "Earth is round"
我正在使用 MATLAB 2013 版本。
解决方案
您可以使用以下语法:
res = ['"' 'Earth is round' '"']
结果示例
脚本
['"' 'Earth is round' '"']
'Earth is round'
输出
ans = "Earth is round"
ans = Earth is round
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句