Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我得到一个包含两行句子的字符串:
'hello this is my first. program matlab'
我想将句子更改为在线表示:
'hello this is my first.program matlab'
我怎么能用 matlab 做到这一点?
替换所有出现的\nto''
\n
''
myNewSt = strrep(mySt,sprintf('\n'),'');
例如,键入:
strrep( sprintf('this is my \n string'),sprintf('\n'),'')